|
I finally understand the c-weenies tagline of "1+1=4 for sufficiently large values of 1". But the comment made earlier was about three significant places. Hundredths in your example is three significant digits. In my humble opinion, for most business reporting, accuracy is better served with three significant digits than it is with careful attention to pennies. Of course audit trails and balancing entries need to balance to pennies, but for sales, marketing, trend-analysis, and most reporting requirements anything beyond three significant digits is confusing and clouds the relationships of the numbers for most managers. _______________________ Booth Martin Booth@MartinVT.com http://www.MartinVT.com _______________________ Don <dr2@cssas400.com> Sent by: owner-midrange-l@midrange.com 07/04/2000 10:55 PM Please respond to MIDRANGE-L To: Douglas Handy <dhandy1@bellsouth.net> cc: MIDRANGE-L@midrange.com Subject: Floating point implementation - was something else... Doug, Hans, et al.. If I'm misunderstanding this, my apologies and would appreciate the correctings.....:) I expect to see FP errors by definition. That's not what my concern was...my concern was with the point of significant figures that the error would be expected to occur....HUNDRETHS!. And for a small number! What I'm hearing is that if I multiply 1.1 * 2.2 and if I get 2.41 or 2.43 (2.42 is correct) I should be happy. I contend that this is a compiler or internal error... OR, if I send a function a constant 2.42, I should be content that if picks some number between 2.40 and 2.50... That's a problem. Yeah, if I'm converting from Punts (0.8271/USD) to Turkish Lira(621550.00/USD), I may have a natural floating point concern I would expect to see in the ten-thousanths position...of the RESULT(product)...but if you're going to sell me 1/10000 of a Punt........:) Which is to say, that in most non-cascading calculations, this kind of error is normative and ignored due to it's insignificance... Interestingly enough, I wrote some currency arbit code in Borland Pascal years ago, using "real" fields that we never had any problems with...and it worked....:) ...just back from the fireworks...:) Don in DC On Tue, 4 Jul 2000, Douglas Handy wrote: > Don, > > >I've done many years of eco and financials sims on many languages and to > >have roundoff in the HUNDRETHS position is just unforgivable. > > Which is why one normally wants to avoid floating-point for currency > stuff (i.e., most business applications). And when you do need to use > it, make sure you use half-adjust. Also it seems best to isolate just > the part of the formula which uses float to just a single expression > on the EVAL, and put the result back into a packed number (with > half-adjust). Then continue the formula in another expression. Or > use %DECH() in the formula where needed. > > I think many languages just perform the half-adjust implicitly or as a > by-product of a print formatting expression, whereas RPG makes you do > the half-adjust explicitly. > > Doug > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@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 > +--- > +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@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 +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@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.