From: "Peña, Botp" Date: 2007-09-01T11:42:03+09:00 Subject: Re: 0.06 == 0.06 returns false in Ruby? From: Robert Klemme [mailto:shortcutter@googlemail.com] # Well, you could provide your formula as strings and convert it to # something that creates BigDecimals along the way, like # irb(main):015:0> "0.01+0.05".gsub(%r{\d+(?:\.\d*)?}, # "BigDecimal.new('\\&')") # => "BigDecimal.new('0.01')+BigDecimal.new('0.05')" # irb(main):016:0> eval("0.01+0.05".gsub(%r{\d+(?:\.\d*)?}, # "BigDecimal.new('\\&')")) # => # # note this is of course not a proper solution since the RX does not # match all valid floats :) on my case, i just want ruby to default to bigdeci (or whatever i want) instead of float. meaning, i choose any math processor i want. is that possible now, or in near future of ruby? kind regards -botp