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()
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

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

2025-01-10 15:47:30
math.maxinteger
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

math.maxinteger

2025-01-10 15:47:30
math.ult()
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

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.

2025-01-10 15:47:30
math.pi
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

math.pi The value of π.

2025-01-10 15:47:30
math.min()
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

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

2025-01-10 15:47:30
math.tan()
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

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

2025-01-10 15:47:30
math.max()
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

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

2025-01-10 15:47:30
math.fmod()
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

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

2025-01-10 15:47:30
math.asin()
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

math.asin (x) Returns the arc sine of x (in radians).

2025-01-10 15:47:30
math.atan()
  • References/Lua/Lua/Standard Libraries/Mathematical Functions

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

2025-01-10 15:47:30