From: Maciej Tomaka Date: 2008-08-26T20:23:23+09:00 Subject: Re: BigDecimal with Float comparision bug. Maciej Tomaka wrote: > Stefano Crocco wrote: >> On Tuesday 26 August 2008, Maciej Tomaka wrote: >>> Decimal: >>> What do you think about it? >>> >>> Regards >> >> It works correctly for me (ruby 1.8.7-p72) on gentoo linux (linux >> 2.6.25, gcc >> 4.3.1). Which version of ruby are you using? >> >> Stefano > > It worked previously for me now it does not work. > Sorry , I have forgot to write it: > > The test was made on linux x64 ruby version: > > Fails: > > ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux] > ruby 1.8.5 (2006-08-25) [x86_64-linux] > > Good: > > ruby 1.8.6 (2007-06-07 patchlevel 36) [i386-linux] > ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-freebsd4] > ruby 1.8.5 (2006-08-25) [i386-freebsd6] > ruby 1.8.4 (2005-12-24) [i386-freebsd4] Full tests gave: ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-freebsd4] ruby 1.8.5 (2006-08-25) [i386-freebsd6] ruby 1.8.2 (2004-12-25) [i386-freebsd5] >> (1..1000).select { |d| BigDecimal.new("#{d}.0") != d.to_f }.size => 304 ruby 1.8.6 (2007-06-07 patchlevel 36) [i386-linux] >> (1..1000).select { |d| BigDecimal.new("#{d}.0") != d.to_f }.size => 141 ruby 1.8.5 (2006-08-25) [x86_64-linux] ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux] >> (1..1000).select { |d| BigDecimal.new("#{d}.0") != d.to_f }.size => 414 I am compiling most recent version of ruby now. Regards -- Posted via http://www.ruby-forum.com/.