math
Contains math functions and constants
Constants
E : number = 2.718281828459045
PI : number = 3.141592653589793
Functions
abs(x) — absolute value of x
acos(x) — arc cosine
asin(x) — arc sine
atan(x) — arc tangent
atan2(y, x) — returns angle θ whose tangent is the ratio of two numbers
cbrt(x) — cube root
ceil(x) — returns the ceiling of x
use math
ceil(6.4) // 7
copySign(magnitude, sign) — returns a value with the magnitude of x and the sign of y
cos(x) — trigonometric cosine
cosh(x) — hyperbolic cosine
exp(x) — ex
expm1(x) — ex-1
floor(x) — returns floor of x
use math
floor(3.8) // 3
getExponent(x) — returns the unbiased exponent used in the representation of a double or float
hypot(x, y) — returns the square root of the sum of squares of its arguments
IEEEremainder(x, y) — returns the remainder resulting from the division of a specified number by another specified number. This operation complies with the remainder operation defined in Section 5.1 of ANSI/IEEE Std 754-1985; IEEE Standard for Binary Floating-Point Arithmetic; Institute of Electrical and Electronics Engineers, Inc; 1985.
log(x) — returns the logarithm of a specified number
log1p(x)
log10(x) — returns the base 10 logarithm of a specified number
max(x, y) — returns the larger of two specified numbers
min(x, y) — returns the smaller of two numbers
nextAfter(x, y)
nextUp(x)
pow(x, y) — returns a specified number raised to the specified power
rint(x)
round(x) — rounds a value to the nearest integer or to the specified number of fractional digits
signum(x) — returns an integer that indicates the sign of a number
sin(x)
sinh(x)
sqrt(x)
tan(x)
tanh(x)
toDegrees(x)
toRadians(x)
ulp(x)