Lua.VM.Stdlib.Math (Lua v1.0.0-rc.2)

View Source

Lua 5.3 math standard library.

Provides mathematical functions including trigonometry, logarithms, random number generation, and numeric utilities.

Functions

  • math.abs(x) - Returns the absolute value of x
  • math.acos(x) - Returns the arc cosine of x (in radians)
  • math.asin(x) - Returns the arc sine of x (in radians)
  • math.atan(y [, x]) - Returns the arc tangent of y/x (in radians)
  • math.ceil(x) - Returns the smallest integer >= x
  • math.cos(x) - Returns the cosine of x (in radians)
  • math.exp(x) - Returns e^x
  • math.floor(x) - Returns the largest integer <= x
  • math.fmod(x, y) - Returns the remainder of x/y rounded toward zero
  • math.log(x [, base]) - Returns the logarithm of x in the given base (default e)
  • math.max(x, ...) - Returns the maximum value among arguments
  • math.min(x, ...) - Returns the minimum value among arguments
  • math.pi - The value of π
  • math.random([m [, n]]) - Returns a pseudo-random number
  • math.randomseed(x) - Sets the seed for the pseudo-random generator
  • math.sin(x) - Returns the sine of x (in radians)
  • math.sqrt(x) - Returns the square root of x
  • math.tan(x) - Returns the tangent of x (in radians)
  • math.tointeger(x) - Converts x to an integer, or nil if not possible
  • math.type(x) - Returns "integer", "float", or nil
  • math.huge - A value larger than any other numeric value
  • math.maxinteger - Maximum value for an integer
  • math.mininteger - Minimum value for an integer