| title | Math |
|---|
This library provides basic mathematical functions.
Returns the absolute, or non-negative value, of a given value.
>>> math.abs(-100);
100Returns the inverse cosine in radians of the given value.
>>> math.acos(1);
0
>>> math.acos(0);
1.5708Returns the inverse sine in radians of the given value.
>>> math.asin(0);
0
>>> math.asin(1);
90Returns the inverse tangent in radians.
>>> var c = math.cos(0.8);
>>> var s = math.cos(0.8);
>>> math.atan(s/c);
45Returns the integer no greater than the given value (even for negatives).
>>> math.ceil(0.5);
1
>>> math.ceil(-0.5);
-0Return the cosine value for the given value in radians.
>>> math.cos(math.pi() / 4);
0.999906Returns the integer no less than the given value (even for negatives).
>>> math.floor(0.5);
0
>>> math.floor(-0.5);
-1Return the maximum value from a variable length list of arguments.
>>> math.max(1.2, -7, 3);
3
>>> math.max(1.2, 7, 3);
7Returns a part of the constant Pi.
>>> math.pi();
3.14159