abs()
Returns the absolute value of a given number.
Syntax | abs(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | The target number | |
Return Type | UINT |
RETURN abs(-2.32)
Result:
abs(-2.32) |
---|
2.32 |
ceil()
Rounds a given number up to the nearest integer.
ceiling()
is a synonym toceil()
.
Syntax | ceil(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | The target number | |
Return Type | INT |
For item in [-2.92, 4.2]
RETURN ceil(item)
Result:
ceil(item) |
---|
-2 |
5 |
exp()
Computes the value of Euler's number 𝑒 raised to the power of a given number, where 𝑒 is approximately equal to 2.71828.
Syntax | exp(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | The power to which 𝑒 is raised | |
Return Type | DOUBLE |
RETURN exp(2)
Result:
exp(2) |
---|
7.38905609893065 |
floor()
Rounds a given number down to the nearest integer.
Syntax | floor(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | The target number | |
Return Type | INT |
For item in [-2.92, 4.2]
RETURN floor(item)
Result:
floor(item) |
---|
-3 |
4 |
ln()
Computes the natural logarithm of a given number, i.e., the logarithm to the base 𝑒 (Euler's number, approximately 2.71828).
Syntax | ln(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | A positive number to for which the logarithm is to be computed | |
Return Type | DOUBLE |
RETURN ln(100)
Result:
ln(100) |
---|
4.60517018598809 |
log()
Computes the logarithm of a specified number with respect to a given base.
Syntax | log(<base>, <num>) |
||
Arguments | Name | Type | Description |
<base> |
Numeric | A postive number as the base of the logarithm | |
<num> |
Numeric | A positive number to for which the logarithm is to be computed | |
Return Type | DOUBLE |
RETURN log(2, 8)
Result:
log(2, 8) |
---|
3 |
log10()
Computes the base 10 logarithm of a given number.
Syntax | log10(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | A positive number to for which the logarithm is to be computed | |
Return Type | DOUBLE |
RETURN log10(100)
Result:
log10(100) |
---|
2 |
mod()
Computes the modulus, or the remainder when one number is divided by another.
Syntax | mod(<dividend>, <divisor>) |
||
Arguments | Name | Type | Description |
<dividend> |
Numeric | The number to be divided | |
<divisor> |
Numeric | The number by which the dividend is divided | |
Return Type | DOUBLE |
RETURN mod(9.2, 2)
Result:
mod(9.2, 2) |
---|
1.2 |
pi()
Returns the mathematical constant π (pi) approximately equal to 3.14159. Pi is the ratio of a circle's circumference to its diameter in Euclidean geometry.
Syntax | pi() |
Return Type | DOUBLE |
RETURN pi()
Result:
pi() |
---|
3.14159265358979 |
power()
Raises a number to the power of another number.
Syntax | power(<base>, <exponent>) |
||
Arguments | Name | Type | Description |
<base> |
Numeric | The number to be raised to a power | |
<exponent> |
Numeric | The power to which the base is raised | |
Return Type | DOUBLE |
RETURN power(2, 4)
Result:
power(2, 4) |
---|
16 |
round()
Returns the nearest value of a given number, rounded to a specified position of digits. If two nearest values are equidistant, it returns the one with the larger absolute value.
Syntax | round(<num>, [<digit>]) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | The target number to be rounded | |
<digit> |
INT |
The position of digits to keep:
|
|
Return Type | DOUBLE |
RETURN round(3.1415926, 3)
Result:
round(3.1415926, 3) |
---|
3.142 |
sqrt()
Computes the square root of a given number.
Syntax | sqrt(<num>) |
||
Arguments | Name | Type | Description |
<num> |
Numeric | The target number | |
Return Type | DOUBLE |
RETURN sqrt(16)
Result:
sqrt(16) |
---|
4 |