RPG: Differences in EVAL

1,215 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.
ASKED: August 26, 2008  4:33 AM
UPDATED: June 24, 2013  6:45 PM

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following