Re: Really strange problem, for very bright people
Daniel Rail <[email protected]> Sat, 9 Aug 2003 08:41:08 -0300
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <[email protected]> |
Hi, At August 9, 2003, 00:23, George J Belland wrote: > The reason is probably the rounding errors incurred during processing differ when the > order of the values changes. Actually, in this case, it's a rounding problem. Floating-point values are never guaranteed to be exact, and are considered approximate numerics. When doing floating-point arithmetics, the CPU's rounding function is never called, unless specifically asked for. In regards to the rounding errors that you refer to, the CPU uses banker's rounding as per IEEE standard, and banker's rounding round the number to the closest even number. But, it also depends if there's a specific rounding technique that is used by the spreadsheet, and that rounding technique might not be banker's rounding, as per your example. I'm pretty sure, that if you would perform the same calculations in Delphi, you probably would get different results, since Delphi uses the CPU's rounding function. Just some food for thought. -- Best regards, Daniel Rail Senior System Engineer ACCRA Group Inc. (www.accra.ca) ACCRA Med Software Inc. (www.filopto.com) ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/i7folB/TM ---------------------------------------------------------------------~-> CodeCoffer - new Delphi code protection Tool! http://www.delphicollection.com/public/CodeCoffer.htm --------------------------------------------------------------- Unsubscribe:[email protected] List owner:[email protected] --------------------------------------------------------------- Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/