From: "John W. Kennedy" Date: 2004-05-13T04:58:53+09:00 Subject: Re: Major Addition Bug? Sean O'Dell wrote: > Funny though, if I set a variable to 1547.91 exactly, it is represented just > fine. No it isn't. ruby -e "puts sprintf('%20.13f', 1547.91)" > I had to massage my floating point math in C/C++ a lot many years ago, but I > always assumed it was a flaw in the MS compiler, Kindly get in touch with your C/C++ teacher and shoot him. What we are talking about here is a basic characteristic of nearly all computers made since the mid-1960's, and a large fraction of the computers made before then. Only a handful of languages support exact decimal arithmetic (COBOL, PL/I, Ada, Java, and REXX come to mind), and IBM zSeries and iSeries mainframes are about the only modern machines capable of doing decimal arithmetic in hardware. -- John W. Kennedy "Compact is becoming contract, Man only earns and pays." -- Charles Williams. "Bors to Elayne: On the King's Coins"