Skip to content

Functions

FunctionNameBehaviour
sqrt()Square RootReturns the square root of a number (also known as )
cbrt()Cube RootReturns the cube root of a number
abs()Absolute valueReturns the absolute value of a number (i.e makes a negative number positive)
round()RoundReturns the nearest integer (half-away-from-zero). Also accepts a second arg for decimal places.
ceil()CeilingRounds up to the nearest integer
floor()FloorRounds down to the nearest integer
sin()SineReturns the sine of an angle (in radians)
cos()CosineReturns the cosine of an angle (in radians)
tan()TangentReturns the tangent of an angle (in radians)
ln()Natural LogarithmThe natural logarithm of a number is its logarithm to the base of the mathematical constant e.
log2Logarithm Base 2Returns the logarithm of a number to the base 2
log10Logarithm Base 10Returns the logarithm of a number to the base 10
acos()Arc CosineReturns the arc cosine of a number (inverse of cosine)
asin()Arc SineReturns the arc sine of a number (inverse of sine)
atan()Arc TangentReturns the arc tangent of a number (inverse of tangent)
csc()CosecantReturns the cosecant of an angle (1/sin)
sec()SecantReturns the secant of an angle (1/cos)
cot()CotangentReturns the cotangent of an angle (1/tan)
exp()ExponentialReturns the value of e raised to the power of a number
fact()FactorialReturns the factorial of a number n! (if the number is negative, the absolute value of it is used)
sqrt(16) | 4
cbrt(27) | 3
abs(-5) | 5
fact(5) | 120
ln(20) | 3
log2(32) | 5
ln(e) | 1
round(1.5) | 2
ceil(1.1) | 2
floor(1.9) | 1
round(3.14159, 2) | 3.14

See the Rounding page for natural-language rounding syntax and more examples.

These functions accept two or more arguments separated by commas.

FunctionArityBehaviour
min(a, b, …)≥1Returns the smallest of its arguments
max(a, b, …)≥1Returns the largest of its arguments
clamp(x, lo, hi)3Constrains x to the range [lo, hi]. Errors if lo > hi
log(x, base)2Logarithm of x to an arbitrary base
hypot(a, b, …)≥1Returns √(a² + b² + …)
gcd(a, b, …)≥2Greatest common divisor (integers only)
lcm(a, b, …)≥2Least common multiple (integers only)
sum(a, b, …)≥1Sum of its arguments
avg(a, b, …)≥1Arithmetic mean
median(a, b, …)≥1Median value
stddev(a, b, …)≥2Sample standard deviation (uses n−1 denominator)
min(3, 7, 2) | 2
max(3, 7, 2) | 7
clamp(15, 0, 10) | 10
log(1000, 10) | 3
hypot(3, 4) | 5
gcd(12, 18) | 6
lcm(4, 6) | 12
sum(1, 2, 3, 4) | 10
avg(1, 2, 3, 4) | 2.5
median(1, 2, 3, 4, 5) | 3
stddev(2, 4, 4, 4, 5, 5, 7, 9) | 2

sum and avg also exist as bare keywords that aggregate previous consecutive lines — see Totals and Subtotals.

To define your own functions like f(x) = 2*x + 1, see User-Defined Functions.