|
//--- forwarded letter ------------------------------------------------------- > X-Mailer: Mozilla 4.04 [en] (Win95; I) > Date: Tue, 24 Feb 98 19:50:31 -0500 > From: "Booth Martin" <boothm@ibm.net> > To: MIDRANGE-L@midrange.com > Reply-To: MIDRANGE-L@midrange.com > Subject: Re: CVTILERPG > > Wait a second... EVAL division changes the length of fields? If I do an >EVAL > dividing Annual Profit by Annual Sales, times 100 to get a percent, will I be > getting a 10-decimal answer? > 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. 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. There is a technical writer sitting somewhere in Toronto muttering "Why do I bother, no-one reads the manual anyway!". Regards, Simon Coulter. //---------------------------------------------------------- // FlyByNight Software AS/400 Technical Specialists // Phone: +61 3 9419 0175 Mobile: +61 3 0411 091 400 // Fax: +61 3 9419 0175 E-mail: shc@flybynight.com.au // // Windoze should not be open at Warp speed. +--- | 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-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.