The following functions are useful for performing various simple mathematical calculations.
Returns the absolute value of a given number. The absolute value is the positive value of any number.
Syntax: | abs(Number) |
Arguments: |
|
Examples: |
|
Returns the sign of a given number. The sign function returns 1 if the number is above or equal to zero, and returns -1 if less than zero.
Syntax: | sign(Number) |
Arguments: |
|
Examples: |
|
Returns a number raised to the power of an exponent.
Syntax: | pow(Number,Power) |
Arguments: |
|
Examples: |
|
Returns the square root of a given number.
Syntax: | sqrt(Number) |
Arguments: |
|
Examples: |
|
Returns the larger of two given numbers.
Syntax: | max(Number1, Number2) |
Arguments: |
|
Examples: |
|
Returns the smaller of two given numbers.
Syntax: | min(Number1, Number2) |
Arguments: |
|
Examples: |
|
Returns the integer remainder from dividing one number by another. This function is useful for repeating an animation every given number of frames.
Syntax: | mod(Number, Divisor) |
Arguments: |
|
Examples: |
|