The maximum size of each operand is 18 decimal digits. The composite of operands is a hypothetical data item resulting from aligning the operands at the decimal point and then superimposing them on one another. It must not contain more than 18 decimal digits.
For example, assume that each item is defined as follows in the Data Division:
A PICTURE 9(7)V9(5). B PICTURE 9(11)V99. C PICTURE 9(12)V9(3).If the following statement is executed, the composite of operands consists of 17 decimal digits:
ADD A B TO CIt has the following implicit description:
COMPOSITE-OF-OPERANDS PICTURE 9(12)V9(5).
In the ADD and SUBTRACT statements, if the composite of operands is 18 digits or less, the compiler ensures that enough places are carried so that no significant digits are lost during execution. The following table shows how the composite of operands is determined for arithmetic statements:
Table 35. How the Composite of Operands is Determined | |
Statement | Determination of the Composite of Operands |
---|---|
SUBTRACT ADD |
Superimposing all operands in a given statement (except those following the word GIVING) |
MULTIPLY | Superimposing all receiving data items |
DIVIDE |
Superimposing all receiving data items, except the REMAINDER data item |
COMPUTE | Restriction does not apply |
In all arithmetic statements, it is important to define data with enough digits and decimal places to ensure the desired accuracy in the final result.
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.