Mathematical Functions

Articles

abs
Returns the absolute (non-negative) value of a number. Function result = abs(input) Arguments Argument Data Type input numeric result numeric Comments Absolute value function that converts negative numbers to positive. Exam...
ceiling
Rounds a number up to the next integer. Function result = ceiling(input) Arguments Argument Data Type input numeric result int Comments Rounds up to the next integer. Positive numbers are rounded up. Negative numbers are rou...
exp
Calculates the result of raising the natural base 'e' to the exponent specified. Function result = exp(exponent) Arguments Argument Data Type exponent numeric result decimal Comments Raises the constant 'e' to the exponent s...
floor
Rounds a number down to the next integer. Function result = floor(input) Arguments Argument Data Type input numeric result int Comments Positive numbers are rounded down. Negative numbers are rounded away from zero. Example...
log
Calculates the logarithm of a positive number.  Function result = log(input, [base]) Arguments Argument Data Type input numeric base numeric (optional) result decimal Comments Perform a natural logarithm (base 'e')  if t...
log10
Calculates the base-10 logarithm of a number. Function result = log10(input) Arguments Argument Data Type input numeric result decimal Comments Base 10 logarithm. Zero and negative inputs evaluate to null. Examples result...
power
Calculates the result of raising one number to the power of another number. Function result = power(input, exponent) Arguments Argument Data Type input any result any Comments Raises the input value to the specified exponent...
round
Rounds a decimal value to the specified number of decimal places. Function result = round(value, precision) Arguments Argument Data Type value numeric precision numeric result decimal Comments If a number is halfway betw...
sign
Returns 1, 0 or -1 for positive, zero and negative respectively. Function result = sign(input) Arguments Argument Data Type input numeric result decimal Examples result = sign(-16) /* result = -1 */ result = sign(5) /* r...
square
Calculates the square of a number. Function result = square(input) Arguments Argument Data Type input numeric result numeric Comments Squares the number, that is multiplies it by itself. Examples result = square(8) /* re...
sqrt
Calculates the square root of a number. Function result = sqrt(input) Arguments Argument Data Type input numeric result decimal Comments If the input number is negative then the result will be null. Examples result = sqrt...
rand
Generates a random number. Function There are two distinct calls which output different data types. n = rand(lower, upper) x = rand() Arguments Argument Data Type lower integer upper integer n integer x decimal Co...