Lua math functions
Lua math functions

These are the functions in the "math" table.

Trigonometry functions use radians. To convert degrees to radians use math.rad.
Or, to look at it another way:


radians = degrees * math.pi / 180


See also the "bc" (big number) library for functions that work with numbers to arbitrary precision.


See Also ...

Topics

DOC_lua_base Lua base functions
DOC_lua_bc Lua bc (big number) functions
DOC_lua_bit Lua bit manipulation functions
DOC_lua_coroutines Lua coroutine functions
DOC_lua_debug Lua debug functions
DOC_lua_io Lua io functions
DOC_lua_os Lua os functions
DOC_lua_package Lua package functions
DOC_lua_rex Lua PCRE regular expression functions
DOC_lua Lua script extensions
DOC_lua_string Lua string functions
DOC_lua_tables Lua table functions
DOC_lua_utils Lua utilities
DOC_scripting Scripting

Lua functions

LUA_math.abs math.abs (Absolute value)
LUA_math.acos math.acos (Arc cosine)
LUA_math.asin math.asin (Arc sine)
LUA_math.atan math.atan (Arc tangent)
LUA_math.atan2 math.atan2 (Arc tangent of v1/v2)
LUA_math.ceil math.ceil (Next higher integer value)
LUA_math.cos math.cos (Cosine)
LUA_math.cosh math.cosh (Hyperbolic cosine)
LUA_math.deg math.deg (Convert from radians to degrees)
LUA_math.exp math.exp (Raises e to a power)
LUA_math.floor math.floor (Next smaller integer value)
LUA_math.fmod math.fmod (The modulus (remainder) of doing: v1 / v2)
LUA_math.frexp math.frexp (Break number into mantissa and exponent)
LUA_math.huge math.huge (A huge value)
LUA_math.ldexp math.ldexp (Compute m* 2^n)
LUA_math.log math.log (Natural log)
LUA_math.log10 math.log10 (Log to the base 10)
LUA_math.max math.max (The highest of one or more numbers)
LUA_math.min math.min (The lowest of one or more numbers)
LUA_math.modf math.modf (Returns the integral and fractional part of its argument)
LUA_math.pi math.pi (The value of pi)
LUA_math.pow math.pow (Raise a number to a power)
LUA_math.rad math.rad (Convert degrees to radians)
LUA_math.random math.random (Generate a random number)
LUA_math.randomseed math.randomseed (Seeds the random number generator)
LUA_math.sin math.sin (Sine)
LUA_math.sinh math.sinh (Hyperbolic sine)
LUA_math.sqrt math.sqrt (Square root)
LUA_math.tan math.tan (Tangent)
LUA_math.tanh math.tanh (Hyperbolic tangent)

(Help topic: general=lua_math)

DOC_contents Documentation contents page