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. Types are annotated in the parenthesis, for example (num) is a number, and (_) is any type.
Math Operators
Addition
Syntax:
Subtraction
Syntax:
Returns the difference of VARNAME2 and VARNAME3 and assigns it to VARNAME1.
Multiplication
Syntax:
Returns the product of VARNAME2 and VARNAME3 and assigns it to VARNAME1.
Division
Syntax:
Returns the quotient of VARNAME2 and VARNAME3 and assigns it to VARNAME1.
Exponentiation
Syntax:
Returns VARNAME2 raised to the power of VARNAME3 and assigns it to VARNAME1.
Math Functions
abs
Syntax:
Returns the absolute value of VARNAME2 and assigns it to VARNAME1.
nthroot
Syntax:
Returns the nth root of VARNAME2 where n is VARNAME3 and assigns it to VARNAME1.
rng
Syntax:
See rand() function for details
rand
Syntax:
Returns a tuple of a random decimal number between VARNAME2 and VARNAME3, and a modified RNG state for the next call and assigns it to VARNAME1. The RNG state is first created with rune VARNAME1 = rng() and then fed into VARNAME4 each time. This functions as both a seed generated with rng() and then shared between each rand() call, and the current number the RNG state is on, allowing for determinstic results. For example:
round
Syntax:
Returns VARNAME2 rounded to the nearest whole number and assigns it to VARNAME1.
floor
Syntax:
ceil
Syntax:
Returns VARNAME2 rounded up to the nearest whole number and assigns it to VARNAME1.
Math Expression Parsing
Syntax:
Assigns the result of evaluating the math expression VARNAME2 to VARNAME1. The expression can contain most standard math functions, operators, and parentheses. For example:
This would assign 14 to VARNAME1.