Lua.VM.Stdlib.Math (Lua v1.0.0-rc.0)
View SourceLua 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 xmath.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 >= xmath.cos(x)- Returns the cosine of x (in radians)math.exp(x)- Returns e^xmath.floor(x)- Returns the largest integer <= xmath.fmod(x, y)- Returns the remainder of x/y rounded toward zeromath.log(x [, base])- Returns the logarithm of x in the given base (default e)math.max(x, ...)- Returns the maximum value among argumentsmath.min(x, ...)- Returns the minimum value among argumentsmath.pi- The value of πmath.random([m [, n]])- Returns a pseudo-random numbermath.randomseed(x)- Sets the seed for the pseudo-random generatormath.sin(x)- Returns the sine of x (in radians)math.sqrt(x)- Returns the square root of xmath.tan(x)- Returns the tangent of x (in radians)math.tointeger(x)- Converts x to an integer, or nil if not possiblemath.type(x)- Returns "integer", "float", or nilmath.huge- A value larger than any other numeric valuemath.maxinteger- Maximum value for an integermath.mininteger- Minimum value for an integer