Skip to content

Math Rules

Most of these rules return a numerical value from operators having one or many numerical operands. When one operand is missing or invalid, the result is missing.

FormatNumerical

Categorical FormatNumerical(Numerical value, Numerical width, Numerical precision)

Returns a string formatted version of a numerical value, with given minimum digit number before separator and given precision after separator.

Example

FormatNumerical(3.141592, 0, 8) // 3.14159200
FormatNumerical(3.141592, 2, 5) // 03.14159
FormatNumerical(3.141592, 0, 0) // 3

Sum

Numerical Sum(Numerical value1, ...)

Sum of numerical values.

Minus

Numerical Minus(Numerical value)

Opposite value.

Diff

Numerical Diff(Numerical value1, Numerical value2)

Difference between two numerical values.

Product

Numerical Product(Numerical value1, ...)

Product of numerical values.

Divide

Numerical Divide(Numerical value1, Numerical value2)

Ratio of two numerical values.

Index

Numerical Index()

Integer index related to the line number of the current record from a data file (start at 1).

Random

Numerical Random()

Random number between 0 and 1.

Each time a database is read, the random seed is forced to the same value, such that the sequence of random numbers will be the same.

Note that the Random rule can be used several times in dictionaries, resulting in independent sequences of random numbers.

Round

Numerical Round(Numerical value)

Closest integer value.

Floor

Numerical Floor(Numerical value)

Largest previous integer value.

Ceil

Numerical Ceil(Numerical value)

Smallest following integer value.

Abs

Numerical Abs(Numerical value)

Absolute value.

Sign

Numerical Sign(Numerical value)

Sign of a numerical value.

Returns 1 for values greater or equal than 0, -1 for values less than 0.

Mod

Numerical Mod(Numerical value1, Numerical value2)

Returns value1 mod value2. Precisely, value1 – value2 * Floor(value1/value2).

Log

Numerical Log(Numerical value)

Natural logarithm.

Exp

Numerical Exp(Numerical value)

Exponential value.

Power

Numerical Power(Numerical value1, Numerical value2)

Power function.

Sqrt

Numerical Sqrt(Numerical value)

Square root function.

Sin

Numerical Sin(Numerical value)

Sine function.

Cos

Numerical Cos(Numerical value)

Cosine function.

Tan

Numerical Tan(Numerical value)

Tangent function.

ASin

Numerical ASin(Numerical value)

Arc-sine function.

ACos

Numerical ACos(Numerical value)

Arc-cosine function.

ATan

Numerical ATan(Numerical value)

Arc-tangent function.

Pi

Numerical Pi()

Pi constant.

Mean

Numerical Mean(Numerical value1, ...)

Mean of numerical values.

StdDev

Numerical StdDev(Numerical value1, ...)

Standard deviation of numerical values.

Min

Numerical Min(Numerical value1, ...)

Min of numerical values (among non-missing values).

Max

Numerical Max(Numerical value1, ...)

Max of numerical values (among non-missing values).

ArgMin

Numerical ArgMin(Numerical value1, ...)

Index of the min value in a numerical series. The index starts at 1 and relates to the first value that is equal to the min.

ArgMax

Numerical ArgMax(Numerical value1, ...)

Index of the max value in a numerical series. The index starts at 1 and relates to the first value that is equal to the max.