Jim Freeze <jim / freeze.org> writes:

> Hmmm..., yes, that makes it clearer.
> I guess what bothers me now is that 2.4/0.2 is not printed by p as
> 11.99999999. (12.0).to_i should never equal 11.
> 
> Is p doing something to floats before it prints them?

Nope: it's just the difference is very, very small...

  a = 2.4/0.2             # => 12.0
  a - 12.0                # => -1.776356839e-15

  sprintf "%20.20g",a	  # => "11.999999999999998224"

Just the way the bits fall.



Dave