Math

Mathematical functions

abs(n)

Returns the absolute value of the given number.

Parameters
Name Required Type Description

n

Yes

Number

Returns

Number

Examples
abs(10) => 10

abs(-10) => 10

ceiling(n, [scale])

returns n with given scale and rounding mode ceiling.

Parameters
Name Required Type Description

n

Yes

Number

scale

No

Number

Returns

Number

Examples
ceiling(1.576) => 2

ceiling(-1.5) => -1

ceiling(-1.56, 1) => -1.5

decimal(n, scale)

returns n with given scale

Parameters
Name Required Type Description

n

Yes

Number

scale

Yes

Number

Returns

Number

Examples
decimal(1/3, 4) => 0.3333

decimal(2.1477, 2) => 2.15

even(number)

Returns true if number is even, false if it is odd.

Parameters
Name Required Type Description

number

Yes

Number

Returns

Boolean

Examples
even(5) => false

even(2) => true

exp(number)

Returns the Euler’s number e raised to the power of number.

Parameters
Name Required Type Description

number

Yes

Number

Returns

Number

Examples
exp(5) => 148.413159102577

floor(n, [scale])

returns n with given scale and rounding mode flooring.

Parameters
Name Required Type Description

n

Yes

Number

scale

No

Number

Returns

Number

Examples
floor(2.1477) => 2

floor(-1.5) => -2

floor(-1.56, 1) => -1.6

log(number)

Returns the natural logarithm (base e) of the number parameter.

Parameters
Name Required Type Description

number

Yes

Number

Returns

Number

Examples
log(10) => 2.30258509299

modulo(dividend, divisor)

Returns the remainder of the division of dividend by divisor.

Parameters
Name Required Type Description

dividend

Yes

Number

divisor

Yes

Number

Returns

Number

Examples
modulo(12, 5) => 2

number(from, [grouping separator], [decimal separator])

converts from to a number

Parameters
Name Required Type Description

from

Yes

Text | Number

grouping separator

No

Text

decimal separator

No

Text

Returns

Number

Examples
number(12) => 12

number("1 002,1417", " ", ",") => 1002.141

number("12,540.25", ",", ".") => 12540.25

odd(number)

Returns true if number is odd, false if it is even.

Parameters
Name Required Type Description

number

Yes

Number

Returns

Boolean

Examples
odd(5) => true

odd(2) => false

round down(n, scale)

returns n with given scale and rounding mode round down.

Parameters
Name Required Type Description

n

Yes

Number

scale

Yes

Number

Returns

Number

Examples
round down(5.5, 0) => 5

round down(-5.5, 0) => -5

round down(1.121, 2) => 1.12

round half down(n, scale)

returns n with given scale and rounding mode round half down.

Parameters
Name Required Type Description

n

Yes

Number

scale

Yes

Number

Returns

Number

Examples
round half down(5.5, 0) => 5

round half down(-5.5, 0) => -5

round half down(1.121, 2) => 1.12

round half up(n, scale)

returns n with given scale and rounding mode round half up.

Parameters
Name Required Type Description

n

Yes

Number

scale

Yes

Number

Returns

Number

Examples
round half up(5.5, 0) => 6

round half up(-5.5, 0) => -6

round half up(1.121, 2) => 1.12

round up(n, scale)

returns n with given scale and rounding mode round up.

Parameters
Name Required Type Description

n

Yes

Number

scale

Yes

Number

Returns

Number

Examples
round up(5.5, 0) => 6

round up(-5.5, 0) => -6

round up(1.121, 2) => 1.13

sqrt(number)

Returns the square root of the given number. If number is negative it returns null.

Parameters
Name Required Type Description

number

Yes

Number

Returns

Number

Examples
sqrt(16) => 4