From: Rodrigo Kochenburger Date: 2008-02-09T01:39:56+09:00 Subject: Re: BigDecimal.new('15.25') == 15.25, false ?? On Feb 8, 12:43 pm, Nobuyoshi Nakada wrote: > Hi, > > At Fri, 8 Feb 2008 22:35:04 +0900, > Rodrigo Kochenburger wrote in [ruby-talk:290370]: > > > I agree this is a problem with BigDecimal. The problem is not with the > > floating point representation: > > > >> "%.30f" % BigDecimal.new("15.00") > > => "15.000000000000001776356839400250" > > >> "%.30f" % BigDecimal.new("15.00").to_f > > => "15.000000000000001776356839400250" > > >> "%.30f" % 15.00 > > => "15.000000000000000000000000000000" > > > Also, it looks like it happens on 64bits machines only. > > Could you try the patch in [ruby-dev:33658]?http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/33658 > > -- > Nobu Nakada Oh yeah baby. That seems to fix it. Great work.