Skip to content

math

math provides some mathematics functions.

Properties

number math.pi
The constant value of pi.
number math.huge
The value equal to or larger than any other numerical value.

Functions

number math.abs(number x)
Returns the absolute value of o.
number math.acos(number x)
The function acos.
  • x The argument in radians.
number math.asin(number x)
The function asin.
  • x The argument in radians.
number math.atan(number x)
The function atan.
  • x The argument in radians.
number math.atan2(number y, number x)
Returns the arc tangent of y/x (in radians).
number math.cos(number x)
The function cos.
  • x The argument in radians.
number math.cosh(number x)
The hyperbolic cosine function.
number math.sin(number x)
The function sin.
  • x The argument in radians.
number math.sinh(number x)
The hyperbolic sine function.
number math.tan(number x)
The function tan.
  • x The argument in radians.
number math.tanh(number x)
The hyperbolic tangent function.
number math.deg(number x)
Returns the angle x (given in radians) in degrees.
  • x The angle in radians.
number math.rad(number x)
Returns the angle x (given in degrees) in radians.
  • x The angle in degrees.
number math.ceil(number x)
Returns the smallest integer equal to or larger than x.
number math.floor(number x)
Returns the largest integer equal to or smaller than x.
number math.max(... xs)
Returns the maximum value among its arguments.
number math.min(... xs)
Returns the minimum value among its arguments.
number math.exp(number x)
Returns the value of e^x.
number math.log(number x)
Returns the natural logarithm of x.
number math.log10(number x)
Returns the base-10 logarithm of x.
number math.pow(number x, number y)
Returns x^y.
number math.sqrt(number x)
Returns the square root of x.