From: Mohammad Khan Date: 2004-05-13T04:23:44+09:00 Subject: Re: Major Addition Bug? I guess, you guys are missing the point, in real life you can't have exact answer of 1/3 + 2.3 + 1.3 but you can have exact answer of 625.91 + 900.00 + 22.00 Mohammad ----- Original Message ----- From: "Hal Fulton" To: "ruby-talk ML" Sent: Wednesday, May 12, 2004 3:15 PM Subject: Re: Major Addition Bug? > Sean O'Dell wrote: > > On Wednesday 12 May 2004 09:53, ts wrote: > > > >>>>>>>"S" == Sean O'Dell writes: > >> > >>S> raise "false" if ((625.91 + 900.00 + 22.00) != 1547.91) > >> > >> Well, this is well known > > > > > > Well known? I had no idea this bug existed until I wrote a line of code that > > double-checked the arithmetic from a different app. I have code all over > > doing simple arithmetic like this. Ruby can't add 3 simple numbers? I don't > > mean to be disproportionately negative, but that shakes my faith more than a > > little. It's just simple arithmetic. How old is this bug? When is it > > getting fixed? > > Offhand I'd say this bug dates back to the 1940s, and isn't > getting fixed any time soon. > > Seriously, I think it's a matter of trying to store an infinite > number of digits in a finite number of bits. > > For a daily life example: How many digits does it take to store > "1/3" exactly? 0.333333... > > > > Hal > > > >