Math
Math module: mathematical functions and constants.
Transcendental functions (sin, cos, exp, etc.) delegate to the math_* builtins which wrap libm. Pure functions (min, max, clamp, lerp) are implemented in March.
Functions
Absolute value of a float.
Arc cosine, returns radians in [0, pi].
Arc sine, returns radians in [-pi/2, pi/2].
Arc tangent, returns radians in (-pi/2, pi/2).
Arc tangent of y/x, using signs to determine the quadrant.
Cube root.
Smallest integer not less than x (returns Float).
Divide a by b, returning None if b is zero.
Compute a % b, returning None if b is zero.
Clamps x to the range [low, high].
Clamps x to the range [low, high].
Cosine of x (in radians).
Hyperbolic cosine.
Euler's number e (2.71828...).
e raised to the power x.
2 raised to the power x.
Largest integer not greater than x (returns Float).
Linear interpolation: lerp(a, b, t) = a + t*(b-a). Returns a when t=0, b when t=1.
Natural logarithm (base e).
Logarithm base 10.
Logarithm base 2.
Returns the larger of two floats.
Returns the larger of two values.
Returns the smaller of two floats.
Returns the smaller of two values.
The mathematical constant pi (3.14159...).
Raises base to the power exp (both Float).
Rounds to the nearest integer (returns Float).
Sine of x (in radians).
Hyperbolic sine.
Square root.
Tangent of x (in radians).
Hyperbolic tangent.
Tau = 2*pi (6.28318...).
Rounds toward zero (returns Float).