Numeric expressions
This section covers numeric expression evaluation rules.
A numeric expression evaluates to a decimal value.
MAIN
DEFINE r, c DECIMAL(10,2)
LET c = 456.22
LET r = c * 2 + ( c / 4.55 )
END MAIN
The operands of a numeric expression can be one of:
- An integer literal.
- A decimal literal.
- A variable or constant of numeric data type.
- A function returning a single numeric value.
- A boolean expression.
- The result of a DATE subtraction, as a number of days.
If a number expression includes an operand whose value is not a numeric data type, the runtime system attempts to convert the value to a number following the data conversion rules.
If an element of a number expression is NULL
,
the expression is evaluated to NULL
.