math: Mathematical functions

This module contains several basic mathematical functions and a few numeric constants. All operations are implemented using floating point arithmetic, and all functions return Float values. Functions accept integer arguments in addition to floats, but integer arguments are converted to floats internally.

All angles are in radians.

Functions

Sqrt(x)
Return the square root of x.
Sin(x)
Return the sine of x.
Cos(x)
Return the cosine of x.
Tan(x)
Return the tangent of x.
ArcSin(x)
Return the arc sine of x.
ArcCos(x)
Return the arc cosine of x.
ArcTan(y[, x])
Return the arc tangent of y or y / x. If x is negative, the magnitude of the result will be chosen to be between Pi / 2 and Pi; otherwise, the magnitude of the result is at most Pi / 2.
Ceil(x)
Return x rounded up to the nearest integer.
Floor(x)
Return x rounded down to the nearest integer.
Round(x)
Return x rounded to the nearest integer.
Trunc(x)
Return x rounded to the nearest integer towards zero.
Exp(x)
Return e**x.
Log(x)
Return the natural logarithm of x.

Note: The logarithm in base y can be calculated as Log(x) / Log(y).

IsInf(x)
Return a boolean indicating whether x is IEEE 754 positive or negative infinity.
IsNaN(x)
Return a boolean indicating whether x is IEEE 754 NaN (Not-a-Number).

Constants

Pi
The constant pi, approximately 3.14159.
E
The constant e, approximately 2.71828.