This module implements various mathematical functions.
Except when explicitly noted otherwise, all return values are floats. The underlying implementations works on double precision floats that are converted back to single precision if the VM does not support double precision.
No exceptions are raised: in case of error, the return value can be infinite or NaN. Such cases can be checked with the provided functions.
The following constants are defined:
Return the tangent of x radians.
Return the cosine of x radians.
Return the sine of x radians.
atan(y / x), in radians. The result is between
pi. The vector in the plane from the origin to point
(x, y)makes this angle with the positive X axis. The point of
atan2()is that the signs of both inputs are known to it, so it can compute the correct quadrant for the angle. For example,
atan2(1, 1)are both
Return the arc tangent of x, in radians.
Return the arc cosine of x, in radians.
Return the arc sine of x, in radians.
Converts rad from radians to degrees.
Converts degree from degrees to radians.
With one argument or with base non positive, return the natural logarithm of x (to base e).
With two arguments, return the logarithm of x to the given base, calculated as
xraised to the power
Return the square root of x.
Trueif x is a NaN (not a number), and
Trueif x is a positive or negative infinity, and
Return the floor of x, the largest integer less than or equal to x.
Return the ceiling of x, the smallest integer greater than or equal to x.