The following code rounds correctly when #AMT is positive, but not when it’s negative:

```
DEFINE DATA LOCAL
1 #AMT (P7.2)
1 #PCT (P3.2)
1 #TMP (P7.2)
1 #RESULT (P7.2)
1 #TYPE (A23)
END-DEFINE
ASSIGN #PCT = 50
WRITE TITLE LEFT JUSTIFIED
'0.10 + (-0.07 * 50 / 100):' /
'Correct answer is 0.06, or 0.14 if +0.07 used instead'
MOVE 'Neg w/ round, COMPUTE' TO #TYPE
ASSIGN #AMT = -0.07
ASSIGN #RESULT = 0.1
COMPUTE ROUNDED #RESULT = #RESULT + (#AMT * #PCT / 100) /*No rounding on expression in parenthesis!
DISPLAY #TYPE #AMT #PCT #RESULT
MOVE 'Pos w/ round, COMPUTE' TO #TYPE
ASSIGN #AMT = 0.07
ASSIGN #RESULT = 0.1
COMPUTE ROUNDED #RESULT = #RESULT + (#AMT * #PCT / 100) /*Expression in parenthesis is rounded!
DISPLAY #TYPE #AMT #PCT #RESULT
END
```

If the expression is simpler, with no parenthesis, then rounding of negative numbers is correct:

```
MOVE 'Neg w/ round, ADD' TO #TYPE
ASSIGN #AMT = -0.07
ASSIGN #RESULT = 0.1
COMPUTE ROUNDED #TMP = #AMT * #PCT / 100
ADD #TMP TO #RESULT
DISPLAY #TYPE #AMT #PCT #RESULT
```

Is this a bug in Natural, or am I not understanding some rule about intermediate results?

We’re running Natural 8.3.7 on AIX 6.1.

Thanks,

Loren Bergeson