From: "Peña, Botp" Date: 2007-09-07T09:29:44+09:00 Subject: Re: 0.06 == 0.06 returns false in Ruby? From: Michael Ulm [mailto:michael.ulm@isis-papyrus.com] # > From: Michael Ulm [mailto:michael.ulm@isis-papyrus.com] # > irb(main):023:0* x=1.0.to_dec/3.0.to_dec # > => # # > irb(main):024:0> x+x+x == 1.0.to_dec # > => true # # Strange, I tested this on two different machines and both gave false # to your last expression. Did you modify BigDecimal#== ? yes. i just used one of the codes posted here.. not sure if it was even your suggested code though. nonetheless, what were you expecting? that 1/3 can be represented exactly in decimal? :) but i really want a way to override float literals, so i do not litter all those to_decs :)) Of course, floats has a lot of merits, but it gives too many surprises fr just a few dec samples. businesswise, it has little use. kind regards -botp