From: Michael Ulm [mailto:michael.ulm / isis-papyrus.com] 
# However (among other problems):
# > x = (1.0/3.0).to_dec

foul..  ^^^^^^^^^ is a float op and not a bigdecimal/to_dec. use atomic operations comparison, pls :)


# > y = 1.0.to_dec / 3.0.to_dec

that is more like it

# > x == y # => false

of course.

so consider eg,

irb(main):057:0> x = 1.0.to_dec / 3.0.to_dec
=> #<BigDecimal:b7d87acc,'0.3333333333 333333E0',16(24)>
irb(main):058:0> y = 2.0.to_dec / 6.0.to_dec
=> #<BigDecimal:b7d7d874,'0.3333333333 333333E0',16(24)>
irb(main):059:0> x == y
=> true

kind regards -botp