Import with #import "std/math".

Finite32 :: (value: float32) -> bool
FloorInteger :: (value: float32) -> s32
CeilInteger :: (value: float32) -> s32
SineDegrees :: (degrees: float32) -> float32

Reduce to [-pi/2, pi/2] before the Taylor polynomial.

CosineDegrees :: (degrees: float32) -> float32
NotANumber :: () -> float64
Infinity :: () -> float64
Finite64 :: (value: float64) -> bool
ScaleByPowerOfTwo :: (value: float64, exponent: s32) -> float64

value × 2^exponent, applied in exact steps.

RoundToInteger :: (value: float64) -> s64

The integer nearest to value, halves away from zero; value must fit s64.

Sqrt :: (value: float64) -> float64
Exp :: (value: float64) -> float64
Expm1 :: (value: float64) -> float64

e^value − 1, accurate near zero: Kahan's correction divides out the rounding of e^value.

Log :: (value: float64) -> float64
Log1p :: (value: float64) -> float64

ln(1 + value), accurate near zero.

Log10 :: (value: float64) -> float64
Log2 :: (value: float64) -> float64
Sin :: (value: float64) -> float64
Cos :: (value: float64) -> float64
Tan :: (value: float64) -> float64
Atan :: (value: float64) -> float64
Atan2 :: (y: float64, x: float64) -> float64
Asin :: (value: float64) -> float64
Acos :: (value: float64) -> float64
Sinh :: (value: float64) -> float64
Cosh :: (value: float64) -> float64
Tanh :: (value: float64) -> float64
Asinh :: (value: float64) -> float64
Acosh :: (value: float64) -> float64
Atanh :: (value: float64) -> float64
Pow :: (base: float64, exponent: float64) -> float64

base^exponent: whole exponents multiply exactly; a negative base needs a whole exponent. Other exponents go through e^(exponent·ln base), which loses about |exponent·ln base| units in the last place.

Cbrt :: (value: float64) -> float64

Source ↗ · All modules