6.7 – Mathematical Functions

This library provides basic mathematical functions. It provides all its functions and constants inside the table math. Functions with the annotation "integer/float" give integer results for integer arguments and float results for float (or mixed) arguments. Rounding functions (math.ceil, math.floor, and math.modf) return an integer when the result fits in the range of an integer, or a float otherwise.

math.sqrt()

math.sqrt (x) Returns the square root of x. (You can also use the expression x^0.5 to compute this value.)

2017-02-21 04:15:15
math.cos()

math.cos (x) Returns the cosine of x (assumed to be in radians).

2017-02-21 04:15:02
math.tointeger()

math.tointeger (x) If the value x is convertible to an integer, returns that integer. Otherwise, returns nil.

2017-02-21 04:15:16
math.ceil()

math.ceil (x) Returns the smallest integral value larger than or equal to x.

2017-02-21 04:15:01
math.log()

math.log (x [, base]) Returns the logarithm of x in the given base. The default for base is e (so that the function returns the natural logarithm

2017-02-21 04:15:07
math.acos()

math.acos (x) Returns the arc cosine of x (in radians).

2017-02-21 04:14:59
math.asin()

math.asin (x) Returns the arc sine of x (in radians).

2017-02-21 04:15:00
math.huge

math.huge The float value HUGE_VAL, a value larger than any other numeric value.

2017-02-21 04:15:06
math.modf()

math.modf (x) Returns the integral part of x and the fractional part of x. Its second result is always a float.

2017-02-21 04:15:11
math.mininteger

math.mininteger

2017-02-21 04:15:10