Many statements in your program might involve arithmetic. For example, each of the following COBOL statements requires some kind of arithmetic evaluation:
COMPUTE REPORT-MATRIX-COL = (EMP-COUNT ** .5) + 1 ADD REPORT-MATRIX-MIN TO REPORT-MATRIX-MAX GIVING REPORT-MATRIX-TOT.
COMPUTE REPORT-MATRIX-COL = FUNCTION SQRT(EMP-COUNT) + 1 COMPUTE CURRENT-DAY = FUNCTION DAY-OF-INTEGER(NUMBER-OF-DAYS + 1)
IF REPORT-MATRIX-COL < FUNCTION SQRT(EMP-COUNT) + 1 IF CURRENT-DAY not = FUNCTION DAY-OF-INTEGER(NUMBER-OF-DAYS + 1)
For each arithmetic evaluation in your program--whether it is a statement, an Intrinsic Function, an expression, or some combination of these nested within each other--how you code the arithmetic determines whether it will be floating-point or fixed-point evaluation.
The following discussion explains when arithmetic and arithmetic comparisons are evaluated in fixed-point and floating-point. For details on the precision of arithmetic evaluations, see Conversions and Precision.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.