Re: rounding



Frank Swarbrick wrote:
Here is some current production code:

77 ADJ-MEMO-CREDITS PIC S9(7)V99 COMP-3.
77 RSRV-ACC-INT PIC S9(6)V999 COMP-3.
77 RSRV-ACC-INT-ROUNDED PIC S9(6)V99 COMP-3.


COMPUTE ADJ-MEMO-CREDITS ROUNDED = ADJ-MEMO-CREDITS - (RSRV-ACC-INT + .005).

<snip>


Interestingly, I can also do this to make it work:
COMPUTE ADJ-MEMO-CREDITS ROUNDED = ADJ-MEMO-CREDITS - RSRV-ACC-INT + .005.

The only difference between this and the original is I removed the parens.

For what it's worth, I'm pretty sure that when you remove the parens, you have to change the '+' to a '-':

COMPUTE ADJ-MEMO-CREDITS ROUNDED =
ADJ-MEMO-CREDITS - RSRV-ACC-INT - .005.

Louis
.