|
Simon wrote: >This is not just EVAL and RPG IV. All programming languages that support >arithmetic expressions >have this 'problem' with division. It is all to do with the intermediate >precision used by the >compiler and is based on the result of evaluating each component in the >expression. There is a >complete section in Chapter 21 of the RPG IV Reference Manual describing >this. > >In general use the precision of intermediary results in EVAL is only a >consideration for division >operations. Although it is easier to run into problems with division, if you are multiplying decimal variables with sufficiently large precision, you can also lose decimal places there as well. > >There was an intention to provide a form of programmer control over the >precision via a keyword on >the H-spec. I don't know if this was ever implemented. Yes, back in V3R7. Have you read chapter 21 lately? > >There is a technical writer sitting somewhere in Toronto muttering "Why do I >bother, no-one reads >the manual anyway!". ROTFL! > >Regards, >Simon Coulter. Cheers! Hans Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.