Coding Standards for Database Files › Coding Standards for RPG III Programs › Techniques in RPG III Programs › Uses of the File Information Data Structure › Calculation Checks
Calculation Checks
Always test that a divisor is not equal to zero before dividing with it.
Example of Testing Divisor Value:
- If a calculation result field for a report or display overflows, fill it with *HIVAL, such as 999s.
- Unless specifically told not to, always half-adjust when adding together two fields of different precision levels.