Skip to content

Math Functions

Before going in note that any time VARNAME or FUNCNAME is written, it means a variable or function in the form Collection@Variable or a literal.

Math Operators

Addition

Syntax:

VARNAME1 = VARNAME2 + VARNAME3
Returns the sum of VARNAME2 and VARNAME3 and assigns it to VARNAME1.

Subtraction

Syntax:

VARNAME1 = VARNAME2 - VARNAME3

Returns the difference of VARNAME2 and VARNAME3 and assigns it to VARNAME1.

Multiplication

Syntax:

VARNAME1 = VARNAME2 * VARNAME3

Returns the product of VARNAME2 and VARNAME3 and assigns it to VARNAME1.

Division

Syntax:

VARNAME1 = VARNAME2 / VARNAME3

Returns the quotient of VARNAME2 and VARNAME3 and assigns it to VARNAME1.

Exponentiation

Syntax:

VARNAME1 = VARNAME2 ^ VARNAME3

Returns VARNAME2 raised to the power of VARNAME3 and assigns it to VARNAME1.

Math Functions

abs

Syntax:

VARNAME1 = abs(VARNAME2)

Returns the absolute value of VARNAME2 and assigns it to VARNAME1.

nthroot

Syntax:

VARNAME1 = nthroot(VARNAME2, VARNAME3)

Returns the nth root of VARNAME2 where n is VARNAME3 and assigns it to VARNAME1.

rand

Syntax:

VARNAME1 = rand(VARNAME2, VARNAME3)

Returns a random decimal number between VARNAME2 and VARNAME3 and assigns it to VARNAME1.

round

Syntax:

VARNAME1 = round(VARNAME2)

Returns VARNAME2 rounded to the nearest whole number and assigns it to VARNAME1.

floor

Syntax:

VARNAME1 = floor(VARNAME2)
Returns VARNAME2 rounded down to the nearest whole number and assigns it to VARNAME1.

ceil

Syntax:

VARNAME1 = ceil(VARNAME2)

Returns VARNAME2 rounded up to the nearest whole number and assigns it to VARNAME1.

Math Expression Parsing

Syntax:

VARNAME1 = math(VARNAME2)

Assigns the result of evaluating the math expression VARNAME2 to VARNAME1. The expression can contain most standard math functions, operators, and parentheses. For example:

VARNAME1 = math("2 * (3 + 4)")

This would assign 14 to VARNAME1.