10.5. Limits and Errors when Rexx Uses Numbers Directly
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 normal whole number limit depends on the default NUMERIC DIGITS setting. The default setting is 9, making the normal whole number limit 999999999.
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)
|
The platform whole number limit.
|
Values of exprr and exprf in the DO instruction
|
The platform whole number limit
|
Values given for DIGITS or FUZZ in the NUMERIC instruction
|
The platform whole number limits (Note: FUZZ must always be less than DIGITS.)
|
Positional patterns in parsing templates
|
The platform whole number limit
|
Number given for option in the TRACE instruction
|
The platform whole number limit
|
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.