ILE COBOL Language Reference
When the compiler handles a mixed function as fixed-point arithmetic, the
result will be either integer or fixed-point with decimals (when any argument
is floating-point, the function becomes a floating-point function and will
follow floating-point rules). For MAX, MIN, RANGE, REM,and SUM, the
outer-dmax is always equal to the inner-dmax. To determine the
precision of the result returned for these functions, apply the rules for
fixed-point arithmetic to each step in the algorithm used to calculate the
function result.
- Assign the first argument to your function result.
- For each remaining argument:
- Compare the algebraic value of your function result with the
argument.
- Assign the greater of the two to your function result.
- Assign the first argument to your function result.
- For each remaining argument:
- Compare the algebraic value of your function result with the
argument.
- Assign the lesser of the two to your function result.
- Use the steps for MAX to select your maximum argument.
- Use the steps for MIN to select your minimum argument.
- Subtract the minimum argument from the maximum.
- Assign the difference to your function result.
- Divide argument-1 by argument-2.
- Remove all noninteger digits from the result of step 1.
- Multiply the result of step 2 by argument-2.
- Subtract the result of step 3 from argument-1.
- Assign the difference to your function result.
- Assign the value 0 to your function result.
- For each argument:
- Add the argument to your function result.
- Assign the sum to your function result.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.