× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Scott,
Yes, that's basically what I was asking. I didn't see anything in the manual
that linked to the precision rules on the %DECH() BIF, so I assumed it
rounded correctly. I generally use that only because I hate coding "eval" in
free-form, but that's beside the point.

I'm very glad you explained it though. It actually made me re-read the
documentation and understand it a bit better with your explanation of it.
Also, it says the compiler will generate a warning when it's dropping
decimals. Looks like a good reason to actually read the listing ;-)

--
James R. Perkins
http://twitter.com/the_jamezp


On Mon, Aug 10, 2009 at 23:59, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>wrote:

Hi James,

Thanks for the kind words. Thanks also to Jerry Adams for his
exceptionally kind words.

Does the %DECH() BIF do the same thing under the covers as EVAL(H)? I
would assume not, but I am curious if you know.

EVAL(H) tells RPG that you want to half-adjust the number when it's
assigned to the result (by "result", I mean the variable to the left of
the equal sign -- not the RPG "result field" which doesn't exist when
EVAL is used.)

%DECH tells RPG that you want to half-adjust the number when it's
assigned to an intermediate field. (One of those "under the covers"
fields I referred to in the previous message) At the same time, %DECH
also specifies the size of that result field. So with %DECH the
half-adjust can be done anywhere in the expression, not just as the
final step (with EVAL(H) it's always on the final step)

Is that what you're asking?
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.