ILE RPG Language Reference
- The length of any field specified in an arithmetic
operation cannot exceed 63 digits. If the result exceeds 63 digits,
digits are dropped from either or both ends, depending on the location
of the decimal point.
- The TRUNCNBR option (as a command parameter or as a keyword on
a control specification) determines whether truncation on the left
occurs with numeric overflow or a runtime error is generated. Note
that TRUNCNBR does not apply to calculations performed within expressions.
If any overflow occurs within expressions calculations, a run-time
message is issued. In addition, TRUNCNBR does not apply to arithmetic
operations performed in integer or unsigned format.
- Half-adjusting is done by adding 5 (-5 if the field is negative)
one position to the right of the last specified decimal position in
the result field. The half adjust entry is allowed only with arithmetic
operations, but not with an MVR operation or with a DIV operation
followed by the MVR operation. Half adjust only affects the result
if the number of decimal positions in the calculated result is greater
than the number of decimal positions in the result field. Half adjusting
occurs after the operation but before the result is placed in the
result field. Resulting indicators are set according to the value
of the result field after half-adjusting has been done. Half adjust
is not allowed if the result field is float.
[ Top of Page | Previous Page | Next Page | Contents |
Index ]