Numeric Comparisons
You can use any of the comparison operators for comparing numeric strings.
The comparison operators are listed in section Comparison operators. However, you
should not use ==, \==, ¬==,
>>, \>>, ¬>>,
<<, \<<, and ¬<< for comparing
numbers because leading and trailing blanks and leading zeros are significant with these
operators.
A ? Z where ? is any numeric comparison operator, is
identical with: (A - Z) ? '0' It is, therefore, the difference between two
numbers, when subtracted under REXX subtraction rules, that determines their equality.0.The effect of FUZZ is to temporarily reduce the value of DIGITS by the FUZZ value for each numeric comparison. That is, the numbers are subtracted under a precision of DIGITS minus FUZZ digits during the comparison. Clearly the FUZZ setting must be less than DIGITS.
Thus if DIGITS = 9 and FUZZ = 1, the comparison is carried out to 8 significant digits, just as
though NUMERIC DIGITS 8 had been put in effect for the duration of the
operation.
Example
Numeric digits 5
Numeric fuzz 0
say 4.9999 = 5 /* Displays "0" */
say 4.9999 < 5 /* Displays "1" */
Numeric fuzz 1
say 4.9999 = 5 /* Displays "1" */
say 4.9999 < 5 /* Displays "0" */