Skip to content

Math Functions

Tulpar provides a comprehensive math library with 27 built-in functions.

abs(x) // Absolute value
sqrt(x) // Square root
cbrt(x) // Cube root
pow(x, y) // Power (x^y)
hypot(x, y) // Hypotenuse
floor(x) // Round down
ceil(x) // Round up
round(x) // Round to nearest
trunc(x) // Truncate decimal
sin(x), cos(x), tan(x) // Basic trig
asin(x), acos(x), atan(x) // Inverse trig
atan2(y, x) // Two-argument arctan
sinh(x), cosh(x), tanh(x) // Hyperbolic
exp(x) // e^x
log(x) // Natural log (ln)
log10(x) // Base-10 log
log2(x) // Base-2 log
min(a, b, ...) // Minimum value
max(a, b, ...) // Maximum value
random() // Random float [0,1)
randint(a, b) // Random int [a,b]