Arithmetic functions can be used to perform numeric calculations. A list of arithmetic functions that you may use is provided below, along with relevant syntax.
Function |
Type |
Description |
Example |
round(...) |
Rounding |
Round to given precision |
round(my_var, digits = 3) |
pmin(...) |
Minimum |
Get minimum of two or more values |
pmin(var_1, var_2) |
pmax(...) |
Maximum |
Get maximum of two or more values |
pmax(var_1, var2) |
log(...) |
Logarithm |
Take logarithm with given base. Base may be optionally specified (default is base e) |
log(my_var) log(my_var, base = 2) |
floor(...) |
Floor |
Round down to nearest integer |
floor(my_var) |
ceiling(...) |
Ceiling |
Round up to nearest integer |
ceiling(my_var) |
exp(...) |
Exponentiation |
Raise base to given power. Base may be optionally specified (default is base e) |
exp(4.3) exp(my_var, base = 10) |