>Tish
HomeDocs

Math

Math builtins in Tish.

Constants

ConstantValue
Math.PIπ
Math.Ee (Euler's number)

Unary

MethodDescription
Math.abs(x)Absolute value
Math.sqrt(x)Square root
Math.floor(x)Floor
Math.ceil(x)Ceiling
Math.round(x)Round
Math.trunc(x)Truncate
Math.sign(x)Sign (-1, 0, or 1)
Math.sin(x)Sine (radians)
Math.cos(x)Cosine (radians)
Math.tan(x)Tangent (radians)
Math.asin(x)Arc sine
Math.acos(x)Arc cosine
Math.atan(x)Arc tangent
Math.log(x)Natural log
Math.log10(x)Log base 10
Math.log2(x)Log base 2
Math.exp(x)e^x
Math.cbrt(x)Cube root

Binary / variadic

MethodDescription
Math.min(a, b, ...)Minimum
Math.max(a, b, ...)Maximum
Math.pow(base, exp)Exponentiation
Math.atan2(y, x)Arc tangent of y/x
Math.hypot(x, y)√(x² + y²)

Random

MethodDescription
Math.random()Random number in [0, 1)