5. Standard libraries

Start from the beginning
                                        

--------------------------------------------------------------------------------

math.deg (x)

Returns the angle x (given in radians) in degrees.

--------------------------------------------------------------------------------

math.exp (x)

Returns the value ex.

--------------------------------------------------------------------------------

math.floor (x)

Returns the largest integer smaller than or equal to x.

--------------------------------------------------------------------------------

math.fmod (x, y)

Returns the remainder of the division of x by y that rounds the quotient towards zero.

--------------------------------------------------------------------------------

math.frexp (x)

Returns m and e such that x = m2e, e is an integer and the absolute value of m is in the range [0.5, 1) (or zero when x is zero).

--------------------------------------------------------------------------------

math.huge

The value HUGE_VAL, a value larger than or equal to any other numerical value.

--------------------------------------------------------------------------------

math.ldexp (m, e)

Returns m2e (e should be an integer).

--------------------------------------------------------------------------------

math.log (x)

Returns the natural logarithm of x.

--------------------------------------------------------------------------------

math.log10 (x)

Returns the base-10 logarithm of x.

--------------------------------------------------------------------------------

math.max (x, ···)

Returns the maximum value among its arguments.

--------------------------------------------------------------------------------

math.min (x, ···)

Returns the minimum value among its arguments.

--------------------------------------------------------------------------------

math.modf (x)

Returns two numbers, the integral part of x and the fractional part of x.

--------------------------------------------------------------------------------

math.pi

The value of pi.

--------------------------------------------------------------------------------

math.pow (x, y)

Returns xy. (You can also use the expression x^y to compute this value.)

--------------------------------------------------------------------------------

math.rad (x)

Returns the angle x (given in degrees) in radians.

--------------------------------------------------------------------------------

Lua coding guideWhere stories live. Discover now