From: Sean O'Dell Date: 2004-05-13T02:22:10+09:00 Subject: Re: Major Addition Bug? On Wednesday 12 May 2004 10:12, Jim Freeze wrote: > On Thursday, 13 May 2004 at 2:07:52 +0900, 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? > > > > Sean O'Dell > > Sorry, to shake your faith, but consider the following: > > jfn@juno 124 /home/jfn/tmp > cat n.c > int main() > { > printf("%.24f\n", 625.91+900.00+22.00); > } > jfn@juno 125 /home/jfn/tmp > ./a.out > 1547.909999999999854480847716 > > > You might want to try the rational library. I don't expect a script language to have those same rounding problems, so I hope this gets fixed quickly. Thanks for the tip. Sean O'Dell