Docs Demo Source

Math Library

YASL’s math library has the following functions and constants.

Math constants

| Name | Description | |β€”β€”|β€”β€”β€”β€”-| | pi | 3.14… | | nan | Floating point NaN constant | | inf | Floating point Infinity constant |

Math functions

| Name | Arguments | Description | |β€”β€”|———–|β€”β€”β€”β€”-| | abs | n | Returns the absolute value of n. | | exp | n | Returns e raised to the n. | | log | n | Returns the natural logarithm of n. | | sqrt | n | Returns the square root of n. | | cos | n | Returns cosine of n. | | sin | n | Returns sine of n. | | tan | n | Returns tangent of n. | | acos | n | Returns arccosine of n. | | asin | n | Returns arcsine of n. | | atan | n | Returns arctangent of n. | | ceil | n | Returns the ceiling of n. | | floor | n | Returns the floor of n. | | max | args… | Returns the maximum of args. | | min | args… | Returns the minimum of args. | | deg | n | Converts n from radians to degrees. | | rad | n | Converts n from degrees to radians. | | isprime | n | Returns true if n is prime, otherwise false. | | gcd | a, b | Returns the greatest common divisor of a and b. | | lcm | a, b | Returns the lowest common multiple of a and b. | | rand | | Produces a random int. |