When Rexx uses numbers directly, that is, numbers that have not been involved in an arithmetic operation, they are rounded, if necessary, according to the setting of NUMERIC DIGITS.
The following table shows which numbers must be whole numbers and what their limits are:
Table 10-1. Whole Number Limits
Power values (right-hand operand of the power operator) | 999999999 |
Values of exprr and exprf in the DO instruction | The current numeric precision (up to 999999999) |
Values given for DIGITS or FUZZ in the NUMERIC instruction | 999999999 (Note: FUZZ must always be less than DIGITS.) |
Positional patterns in parsing templates | 999999999 |
Number given for option in the TRACE instruction | 999999999 |
When Rexx uses numbers directly, the following types of errors can occur:
Overflow or underflow.
This error occurs if the exponential part of a result exceeds the range that the language processor can handle, when the result is formatted according to the current settings of NUMERIC DIGITS and NUMERIC FORM. The language defines a minimum capability for the exponential part, namely the largest number that can be expressed as an exact integer in default precision. Because the default precision is 9, you can use exponents in the range -999999999 through 999999999.
Because this allows for (very) large exponents, overflow or underflow is treated as a syntax error.
Insufficient storage.
Storage is needed for calculations and intermediate results, and if an arithmetic operation fails because of lack of storage. This is considered as a terminating error.