ILE RPG Language Reference
Guidelines for Choosing the Numeric Format for a Field
You should specify the integer or unsigned format for fields when:
Packed, zoned, and binary formats should be specified for fields
when:
- Using values that have implied decimal positions, such currency
values
- Manipulating values having more than 19 digits
- Ensuring a specific number of digits for a field is important
Float format should be specified for fields when:
- The same variable is needed to hold very small and/or very large
values that cannot be represented in packed or zoned values.
However, float format should not be
used when more than 16 digits of precision are needed.
Note:
Overflow is more likely to occur with arithmetic operations
performed using the integer or unsigned format, especially when integer
arithmetic occurs in free-form expressions. This is because the intermediate
results are kept in integer or unsigned format rather than a temporary
decimal field of sufficient size.
[ Top of Page | Previous Page | Next Page | Contents |
Index ]