Returns the absolute value of x.
Returns the arcus cosine (in radians) of x.
Throws ErrArgument if abs(x) > 1.
Returns the arcus sine (in radians) of x.
Throws ErrArgument if abs(x) > 1.
Returns the arcus tangent (in radians) of x.
Returns the smallest integer greater than or equal to x.
|
print math.ceil(3) → 3
print math.ceil(3.4)→ 4
print math.ceil(-3.4)→ -3
|
Returns the cosine of x (in radians).
Returns ex
Returns the largest integer less than or equal to x.
|
print math.floor(3) → 3
print math.floor(3.4)→ 3
print math.floor(-3.4)→ -4
|
Returns true if x is (positive or negative) infinity, false otherwise.
Returns true if x is not-a-number, false otherwise.
Returns the natural logarithm of x.
Returns xy.
Throws ErrArgument if x < 0 and y is not an integer.
Throws ErrOverflow if x = 0 and y < 0.
|
print math.pow(2, 0.5) → 1.4142135624
print math.pow(-5, 3);→ -125
|
Returns a random number uniformely distributed in the interval 0 (inclusive) to 1 (exclusive). With an argument, initializes the sequence of random numbers with seed. seed can be any number.
The default initialization is based on the current time.
|
math.random(0); for i=1 to 3 do print math.random() end → 0.0038488093
0.6952766137 0.2338878537 |
Rounds x to decimals decimal digits.
|
print math.round(4.5) → 5
print math.round(math.pi, 4)→ 3.1416
|
Returns the cosine of x (in radians).
Returns the square root of x.
Throws ErrArgument if x < 0.
Returns the tangent of x (in radians).
Returns the integral part of x.
|
print math.trunc(3) → 3
print math.trunc(3.4)→ 3
print math.trunc(-3.4)→ -3
|
• const inf = Inf (positive) "infinity".
• const nan = NaN "not-a-number".
• const pi = 3.141592653589793 π.