CALC Examples
Example 1:
|
|
|
|
|
|
|
|
|
|
|
|
|
•••85.10 |
|
|
|
|
••10.15 |
|
|
|
|
••100.05 |
|
| |||
|
|
|
|
••137.50 |
|
|
| ||
No Condition Flag is set.
Example 2:
|
|
|
|
|
|
|
|
|
|
|
|
|
•••23.15 |
|
|
|
|
•8 |
|
|
|
|
••2 |
|
| |||
|
|
|
|
•••-2.10 |
|
|
| ||
The LESS Condition Flag is set.
Example 3:
|
|
|
|
|
|
|
|
|
|
|
|
|
••5 |
|
| |||
|
|
|
|
•12 |
No Condition Flag is set.
Example 4:
|
|
|
|
|
|
|
|
|
|
|
|
|
•55 |
|
|
|
|
122 |
|
|
|
|
•54.23 |
|
| |||
|
|
|
|
•••.00 |
The result is zero. Since neither AMOUNT nor TOTAL contain a decimal digit, the operation is performed with integer precision, i.e., 55/122 = 0. The ZERO Condition Flag is set. If this same calculation were performed using the CALC statement, the result would be not be zero.
Example 5:
|
|
|
|
|
|
|
|
|
|
|
|
|
•55 |
|
|
|
|
122 |
|
|
|
|
•54.23 |
|
| |||
|
|
|
|
•45.08 |
The result is not zero since the literal 100.00 contains a decimal point and it is involved in the first operation, the decimal precision is carried throughout the other operations. No Condition Flag is set.
![]() |