6.7 – Mathematical Functions

This library provides basic mathematical functions. It provides all its functions and constants inside the table math. Functions with the annotation "integer/float" give integer results for integer arguments and float results for float (or mixed) arguments. Rounding functions (math.ceil, math.floor, and math.modf) return an integer when the result fits in the range of an integer, or a float otherwise.

math.deg()

math.deg (x) Converts the angle x from radians to degrees.

2017-02-21 04:15:03
math.maxinteger

math.maxinteger

2017-02-21 04:15:09
math.fmod()

math.fmod (x, y) Returns the remainder of the division of x by y that rounds the quotient towards zero. (integer/float)

2017-02-21 04:15:06
math.pi

math.pi The value of π.

2017-02-21 04:15:11
math.tan()

math.tan (x) Returns the tangent of x (assumed to be in radians).

2017-02-21 04:15:15
math.max()

math.max (x, ···) Returns the argument with the maximum value, according to the Lua operator <. (integer/float)

2017-02-21 04:15:08
math.min()

math.min (x, ···) Returns the argument with the minimum value, according to the Lua operator <. (integer/float)

2017-02-21 04:15:09
math.ult()

math.ult (m, n) Returns a boolean, true if and only if integer m is below integer n when they are compared as unsigned integers.

2017-02-21 04:15:19
math.atan()

math.atan (y [, x]) Returns the arc tangent of y/x (in radians), but uses the signs of both parameters to find the quadrant of the result. (It also handles correctly

2017-02-21 04:15:01
math.acos()

math.acos (x) Returns the arc cosine of x (in radians).

2017-02-21 04:14:59