From: Jason G. [mailto:jasonpurchase / yahoo.com] 
# Subject: 0.06 == 0.06 returns false in Ruby?
# http://www.ruby-forum.com/attachment/193/test.rb

oops, careful w your statement/subject :)

obviously, 0.06 == 0.06.  any language can vouch on that.

irb(main):008:0> 0.06 == 0.06
=> true

the problem crops out here (they trigger when you do operations),

irb(main):009:0> 0.05+0.01 == 0.06
=> false

you can check the diff

irb(main):010:0> (0.05+0.01) - 0.06
=> 6.93889390390723e-18

as mentioned by Dan, careful on comparing floats. And as to any precision subject, there is what we call significant digits..

this floating problem is a faq and is very surprising on such a very high language such as ruby.  can we address this? maybe create flag like $EPSILON=0 or something, or may flag to revert to rational or bigdeci like $FLOAT_PROCESSOR=RATIONAL...

just a thought.

kind regards -botp