The arithmetic comparisons are more flexible than the lexical
comparisons. They are defined for integers, floats and decimals.
For decimals comparison across scales is supported. The same
widening as already defined for the basic operations applies as
1 < 2
1.0 < 2.0
0d1.00D < 2
1 =:= 0d1.00
We also provide evaluable functions min/2 and max/2. These
functions are based on the aforementioned arithmetic comparison.
The type of the return value depends on the order of the arguments
of these evaluable functions:
min, max: integer x integer -> integer
min, max: float x float -> float
min, max: decimal x decimal -> decimal
The constant epsilon allows querying the smallest float number
that when added to one will still result in a float number
different from one without any rounding.
The following built-in predicates are provided for arithmetic comparison. The built-ins arithmetically evaluate their arguments before performing their tests:
The following evaluable functions are provided for arithmetic