|
This is one of the reasons why you don't presume that EVAL will yield "correct answers". IBM is using floating point on EVAL, that is a well known fact. Why did they decide to do that? Who cares? Even though it was a wron decision, in my opinion, it is water under the bridge now. One of the reasons we use RPG is because it did math "correctly". Now RPG (using EVAL) does math just as inaccurately as most other languages and we have to get used to that, or use some of those crazy %DEC or EVAL(M|R|H) things. It is easier to use MULT/DIV if you want correct math results, in my view. -Bob Cozzi -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx Sent: Tuesday, February 17, 2004 12:16 PM To: RPG programming on the AS400 / iSeries Subject: Re: Strange result with exponents... IBM's response: Rob, I just spoke with the RPG developer. The sample you provided will not give you consistent results because the calculations are done with floating point math with large numbers. If you were to do the calculation using multiplication in a loop you would receive the exact calculation at the end of the loop. This limitation of floating point math is not specific to RPGLE but is explained in the RPG Programming manual. Let me know if you have further questions. So, whomever posted this question, was this already answered in like fashion on the other list? Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com rob@xxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 02/17/2004 11:00 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc Fax to Subject Re: Strange result with exponents... IBM recommended the following ptf: MF32083. However that didn't do it for me. I even recompiled the program, signed off, and back on. Back to the drawing board... Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com _______________________________________________ This is the RPG programming on the AS400 / iSeries (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. _______________________________________________ This is the RPG programming on the AS400 / iSeries (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 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.