From: guille lists Date: 2008-10-28T01:50:29+09:00 Subject: float equality Hi, sorry if this is a very naive question (I'm new to ruby), but I haven't found an explication yet. When comparing to floats in ruby I came across this: >> a = 0.1 => 0.1 >> b = 1 - 0.9 => 0.1 >> a == b => false >> a > b => true >> a < b => false >> a <=> b => 1 I'm a bit lost here, shouldn't (0.1) and (1 - 0.9) be equals regarding the == operator? I also found that for example 0.3 == (0.2 + 0.1) returns false, etc. guille PD: I'm using ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]