Skip to content

Number functions

Package: FUNCTION_PACKAGE. Registered by createEngine(); for a slimmer engine, register it explicitly (see choosing packages).

A function takes one or more numbers and gives back another, written with the name first and the inputs in brackets: sqrt(16) is the square root of sixteen. These are the everyday maths functions, the ones a calculator keeps on its keys.

sqrt(16) // 4
abs(-5) // 5
round(3.7) // 4
floor(3.7) // 3
ceil(3.2) // 4
min(3, 7) // 3
max(3, 7) // 7
gcd(12, 18) // 6