## RPG: Differences in EVAL

1230 pts.
Tags:
EVAL(H)
EVAL(M)
EVAL(R)
RPG
I have failed to find the difference between ELAV(R), EVAL(M) and EVAL(H). Please help me to find the difference with one example.

## Answer Wiki

Thanks. We'll let you know when a new response is added.

Type (H) if half adjust is to be performed.

dres s 5s 2
dres1 s 5s 2

C eval res = 139 / 7
c res dsply

19.85

C eval(H) res1 = 139 / 7
c res1 dsply

19.86

Type (M) if the maximum number of digits rule is to be applied.

Type (R) if the result decimal position rule is to be applied: the
precision of a decimal intermediate will be computed such that the
number of decimal places will not be reduced by more than the number
of decimal positions of the result of the assignment.

eval p1 = p1 * p2 * p3;
// p1*p2 -> P(26,4); P(26,4)
// p1*p2*p3 -> P(39,6); P(30,0) (decimal positions are truncated)
eval(r) p1 = p1 * p2 * p3;
// p1*p2 -> P(26,4); P(26,4)
// p1*p2*p3 -> P(39,6); P(30,2) (decimal positions do not drop
// below target decimal positions)

Have no example for Type (M) let me know if any one has example for this

## Discuss This Question:

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.