Skip to content
Blog

Numeric functions

Numeric functions are used to transform and manipulate numeric types. Common functions that have been implemented so far are listed below.

FunctionDescriptionExampleResult
abs(x)returns the absolute value of xabs(-25.2)25.2
acos(x)returns the arccosine of xacos(0.43)1.126304
asin(x)returns the arcsine of xasin(0.4)0.411517
atan(x)returns the arctangent of xatan(0.221)0.217504
atan2(x, y)returns the arctangent of x, yatan2(0.4, 0.2)0.342411
bitwise_xor(x, y)returns the bitwise xor of x and ybitwise_xor(2, 3)1
ceil(x)rounds up x to the next nearest integerceil(4.2)5.0
ceiling(x)alias of ceilceiling(3.27)4.0
cos(x)returns the cosine value of xcos(2.79)-0.938825
cot(x)returns the cotangent of xcot(0.78)1.010855
degrees(x)converts radians to degreedegrees(1.2534)71.814530
even(x)rounds to next even number by
rounding away from 0
even(3.4)4
factorial(x)returns the factorial of xfactorial(4)24
floor(x)rounds down x to the nearest integerfloor(3.3)3
gamma(x)interpolation of (x-1) factorialgamma(2.4)1.242169
lgamma(x)returns the log of gamma(x)lgamma(1.4)-0.119613
ln(x)returns the natural logarithm of xln(2.11)0.746688
log(x)returns the 10-log of xlog(2.11)0.324282
log2(x)returns the 2-log of xlog2(3)1.584963
log10(x)alias of log(x)log10(100)2
negate(x)returns the opposite number of xnegate(100)-100
pi()returns the value of pipi()3.141593
pow(x, y)returns the value of x to the power of ypow(4, 5)1024
radians(x)converts the degree to radiansradians(89)1.553343
round(x, s)rounds x to s decimal placesround(42.651, 1)42.700000
sin(x)returns the sin of xsin(413.31)-0.981897
sign(x)returns the sign of xsign(-451)-1
sqrt(x)returns the square root of xsqrt(4.25)2.061553
tan(x)returns the tangent of xtan(75)-0.420701