Math
Standard Luau math library. All functions are available in any Ionize script.
Available Functions
| Function | Description |
|---|---|
| math.abs | Returns the absolute value of x. |
| math.acos | Returns the arc cosine of x (in radians). |
| math.asin | Returns the arc sine of x (in radians). |
| math.atan | Returns the arc tangent of x (in radians). |
| math.atan2 | Returns the arc tangent of y/x (in radians). |
| math.ceil | Returns the smallest integral value larger than or equal to x. |
| math.clamp | Returns a number between min and max, inclusive. If x is below min or above max, it will return min or max respectively. |
| math.cosh | Returns the hyperbolic cosine of x (assumed to be in radians). |
| math.deg | Converts the angle x from radians to degrees. |
| math.exp | Returns the value e^x (where e is the base of natural logarithms). |
| math.floor | Returns the largest integral value smaller than or equal to x. |
| math.fmod | Returns the remainder of the division of x by y that rounds the quotient towards zero. |
| math.frexp | Decompose x into tails and exponents. Returns m and e such that x = m * (2 ^ e), e is an integer and the absolute value of m is in the range [0.5, 1) (or zero when x is zero). |
| math.ldexp | Returns m * (2 ^ e). |
| math.log | Returns the logarithm of x in the given base. |
| math.log10 | Returns the base 10 logarithm of x. |
| math.max | Returns the argument with the maximum value, according to the Lua operator <. |
| math.min | Returns the argument with the minimum value, according to the Lua operator <. |
| math.modf | Returns the integral part of x and the fractional part of x. |
| math.noise | Returns a value roughly between negative 0.5 and 0.5 generated from its arguments. |
| math.pow | Returns x ^ y. |
| math.rad | Converts the angle x from degrees to radians. |
| math.random | * math.random(): Returns a float in the range [0,1). * math.random(n): Returns a integer in the range [1, n]. * math.random(m, n): Returns a integer in the range [m, n]. |
| math.randomseed | Sets x as the "seed" for the pseudo random generator. |
| math.round | Rounds x to the nearest integer; rounds away from zero if we're midway between two integers. |
| math.sign | Returns negative 1 if x < 0, 0 if x == 0, or 1 if x > 0. |
| math.sin | Returns the sine of x (assumed to be in radians). |
| math.sinh | Returns the hyperbolic sine of x (assumed to be in radians). |
| math.sqrt | Returns the square root of x. |
| math.tan | Returns the tangent of x (assumed to be in radians). |
| math.tanh | Returns the hyperbolic tangent of x (assumed to be in radians). |