6 Mathematical functions

All functions listed here are supported in:

Mathematical functions are supported with float and integer value types, unless stated otherwise.

The functions are listed without additional information. Click on the function to see the full details.

FunctionDescription
absThe absolute value of a value.
acosThe arccosine of a value as an angle, expressed in radians.
asinThe arcsine of a value as an angle, expressed in radians.
atanThe arctangent of a value as an angle, expressed in radians.
atan2The arctangent of the ordinate (value) and abscissa coordinates specified as an angle, expressed in radians.
avgThe average value of the referenced item values.
cbrtThe cube root of a value.
ceilRound the value up to the nearest greater or equal integer.
cosThe cosine of a value, where the value is an angle expressed in radians.
coshThe hyperbolic cosine of a value.
cotThe cotangent of a value, where the value is an angle expressed in radians.
degreesConverts a value from radians to degrees.
eThe Euler’s number (2.718281828459045).
expThe Euler’s number at a power of a value.
expm1The Euler’s number at a power of a value minus 1.
floorRound the value down to the nearest smaller or equal integer.
logThe natural logarithm.
log10The decimal logarithm.
maxThe highest value of the referenced item values.
minThe lowest value of the referenced item values.
modThe division remainder.
piThe Pi constant (3.14159265358979).
powerThe power of a value.
radiansConverts a value from degrees to radians.
randReturn a random integer value.
roundRound the value to decimal places.
signumReturns ‘-1’ if a value is negative, ‘0’ if a value is zero, ‘1’ if a value is positive.
sinThe sine of a value, where the value is an angle expressed in radians.
sinhThe hyperbolical sine of a value, where the value is an angle expressed in radians.
sqrtThe square root of a value.
sumThe sum of the referenced item values.
tanThe tangent of a value.
truncateTruncate the value to decimal places.

Function details

Some general notes on function parameters:

  • Function parameters are separated by a comma
  • Expressions are accepted as parameters
  • Optional function parameters (or parameter parts) are indicated by < >
abs(value)

The absolute value of a value.
Supported value types: Float, Integer, String, Text, Log.
For strings returns: 0 - the values are equal; 1 - the values differ.

Parameter:

  • value - the value to check

The absolute numeric difference will be calculated, as seen with these incoming example values (‘previous’ and ‘latest’ value = absolute difference): ‘1’ and ‘5’ = 4; ‘3’ and ‘1’ = 2; ‘0’ and ‘-2.5’ = 2.5

Example:

  1. abs(last(/host/key))>10
acos(value)

The arccosine of a value as an angle, expressed in radians.

Parameter:

  • value - the value to check

The value must be between -1 and 1. For example, the arccosine of a value ‘0.5’ will be ‘2.0943951’.

Example:

  1. acos(last(/host/key))
asin(value)

The arcsine of a value as an angle, expressed in radians.

Parameter:

  • value - the value to check

The value must be between -1 and 1. For example, the arcsine of a value ‘0.5’ will be ‘-0.523598776’.

Example:

  1. asin(last(/host/key))
atan(value)

The arctangent of a value as an angle, expressed in radians.

Parameter:

  • value - the value to check

The value must be between -1 and 1. For example, the arctangent of a value ‘1’ will be ‘0.785398163’.

Example:

  1. atan(last(/host/key))
atan2(value,abscissa)

The arctangent of the ordinate (value) and abscissa coordinates specified as an angle, expressed in radians.

Parameter:

  • value - the value to check;
  • abscissa - the abscissa value.

For example, the arctangent of the ordinate and abscissa coordinates of a value ‘1’ will be ‘2.21429744’.

Example:

  1. atan(last(/host/key),2)
avg(<value1>,<value2>,…)

The average value of the referenced item values.

Parameter:

  • valueX - the value returned by one of the history functions.

Example:

  1. avg(avg(/host/key),avg(/host2/key2))
cbrt(value)

The cube root of a value.

Parameter:

  • value - the value to check

For example, the cube root of ‘64’ will be ‘4’, of ‘63’ will be ‘3.97905721’.

Example:

  1. cbrt(last(/host/key))
ceil(value)

Round the value up to the nearest greater or equal integer.

Parameter:

  • value - the value to check

For example, ‘2.4’ will be rounded up to ‘3’. See also floor().

Example:

  1. ceil(last(/host/key))
cos(value)

The cosine of a value, where the value is an angle expressed in radians.

Parameter:

  • value - the value to check

For example, the cosine of a value ‘1’ will be ‘0.54030230586’.

Example:

  1. cos(last(/host/key))
cosh(value)

The hyperbolic cosine of a value. Returns the value as a real number, not as scientific notation.

Parameter:

  • value - the value to check

For example, the hyperbolic cosine of a value ‘1’ will be ‘1.54308063482’.

Example:

  1. cosh(last(/host/key))
cot(value)

The cotangent of a value, where the value is an angle expressed in radians.

Parameter:

  • value - the value to check

For example, the cotangent of a value ‘1’ will be ‘0.54030230586’.

Example:

  1. cot(last(/host/key))
degrees(value)

Converts a value from radians to degrees.

Parameter:

  • value - the value to check

For example, a value ‘1’ converted to degrees will be ‘57.2957795’.

Example:

  1. degrees(last(/host/key))
e

The Euler’s number (2.718281828459045).

Example:

  1. e()
exp(value)

The Euler’s number at a power of a value.

Parameter:

  • value - the value to check

For example, Euler’s number at a power of a value ‘2’ will be ‘7.38905609893065’.

Example:

  1. exp(last(/host/key))
expm1(value)

The Euler’s number at a power of a value minus 1.

Parameter:

  • value - the value to check

For example, Euler’s number at a power of a value ‘2’ minus 1 will be ‘6.38905609893065’.

Example:

  1. expm1(last(/host/key))
floor(value)

Round the value down to the nearest smaller or equal integer.

Parameter:

  • value - the value to check

For example, ‘2.6’ will be rounded down to ‘2’. See also ceil().

Example:

  1. floor(last(/host/key))
log(value)

The natural logarithm.

Parameter:

  • value - the value to check

For example, the natural logarithm of a value ‘2’ will be ‘0.69314718055994529’.

Example:

  1. log(last(/host/key))
log10(value)

The decimal logarithm.

Parameter:

  • value - the value to check

For example, the decimal logarithm of a value ‘5’ will be ‘0.69897000433’.

Example:

  1. log10(last(/host/key))
max(<value1>,<value2>,…)

The highest value of the referenced item values.

Parameter:

  • valueX - the value returned by one of the history functions.

Example:

  1. max(avg(/host/key),avg(/host2/key2))
min(<value1>,<value2>,…)

The lowest value of the referenced item values.

Parameter:

  • valueX - the value returned by one of the history functions.

Example:

  1. min(avg(/host/key),avg(/host2/key2))
mod(value,denominator)

The division remainder.

Parameter:

  • value - the value to check;
  • denominator - the division denominator.

For example, division remainder of a value ‘5’ with division denominator ‘2’ will be ‘1’.

Example:

  1. mod(last(/host/key),2)
pi

The Pi constant (3.14159265358979).

Example:

  1. pi()
power(value,power value)

The power of a value.

Parameter:

  • value - the value to check;
  • power value - the Nth power to use.

For example, the 3rd power of a value ‘2’ will be ‘8’.

Example:

  1. power(last(/host/key),3)
radians(value)

Converts a value from degrees to radians.

Parameter:

  • value - the value to check

For example, a value ‘1’ converted to radians will be ‘0.0174532925’.

Example:

  1. radians(last(/host/key))
rand

Return a random integer value. A pseudo-random generated number using time as seed (enough for mathematical purposes, but not cryptography).

Example:

  1. rand()
round(value,decimal places)

Round the value to decimal places.

Parameter:

  • value - the value to check;
  • decimal places - specify decimal places for rounding (0 is also possible).

For example, a value ‘2.5482’ rounded to 2 decimal places will be ‘2.55’.

Example:

  1. round(last(/host/key),2)
signum(value)

Returns ‘-1’ if a value is negative, ‘0’ if a value is zero, ‘1’ if a value is positive.

Parameter:

  • value - the value to check.

For example, a value ‘2.5482’ rounded to 2 decimal places will be ‘2.55’.

Example:

  1. signum(last(/host/key))
sin(value)

The sine of a value, where the value is an angle expressed in radians.

Parameter:

  • value - the value to check

For example, the sine of a value ‘1’ will be ‘0.8414709848’.

Example:

  1. sin(last(/host/key))
sinh(value)

The hyperbolical sine of a value, where the value is an angle expressed in radians.

Parameter:

  • value - the value to check

For example, the hyperbolical sine of a value ‘1’ will be ‘1.17520119364’.

Example:

  1. sinh(last(/host/key))
sqrt(value)

The square root of a value.
This function will fail with a negative value.

Parameter:

  • value - the value to check

For example, the square root of a value ‘3.5’ will be ‘1.87082869339’.

Example:

  1. sqrt(last(/host/key))
sum(<value1>,<value2>,…)

The sum of the referenced item values.

Parameter:

  • valueX - the value returned by one of the history functions.

Example:

  1. sum(avg(/host/key),avg(/host2/key2))
tan(value)

The tangent of a value.

Parameter:

  • value - the value to check

For example, the tangent of a value ‘1’ will be ‘1.55740772465’.

Example:

  1. tan(last(/host/key))
truncate(value,decimal places)

Truncate the value to decimal places.

Parameter:

  • value - the value to check;
  • decimal places - specify decimal places for truncating (0 is also possible).

For example, a value ‘2.5482’ truncated to 2 decimal places will be ‘2.54’.

Example:

  1. truncate(last(/host/key),2)

See all supported functions.