Hi,
I'm a bit confused with some simple floating point arithmetic:
% ruby -e 'puts "#{(1.2 - 1.0) == 0.2}"'
false
% ruby -e 'puts "#{(1.5 - 1.0) == 0.5}"'
true
I'm sure there's a perfectly logical reason for this, but i think i've
been staring at it for too long to see what it is.
Can anyone shed some light on this?
Thanks for your help,
Nick
ps:
% ruby -v
ruby 1.8.3 (2005-06-23) [i486-linux]