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
The mathematical constant pi (3.14159...).
Euler's number e (2.71828...).
Tau = 2*pi (6.28318...).
Absolute value of a float.
Returns the smaller of two values.
Returns the larger of two values.
Returns the smaller of two floats.
Returns the larger of two floats.
Clamps x to the range [low, high].
Clamps x to the range [low, high].
Square root.
Cube root.
Raises base to the power exp (both Float).
e raised to the power x.
2 raised to the power x.
Natural logarithm (base e).
Logarithm base 2.
Logarithm base 10.
Sine of x (in radians).
Cosine of x (in radians).
Tangent of x (in radians).
Arc sine, returns radians in [-pi/2, pi/2].
Arc cosine, returns radians in [0, pi].
Arc tangent, returns radians in (-pi/2, pi/2).
Arc tangent of y/x, using signs to determine the quadrant.
Hyperbolic sine.
Hyperbolic cosine.
Hyperbolic tangent.
Largest integer not greater than x (returns Float).
Smallest integer not less than x (returns Float).
Rounds to the nearest integer (returns Float).
Rounds toward zero (returns Float).
Linear interpolation: lerp(a, b, t) = a + t*(b-a). Returns a when t=0, b when t=1.