2011/9/16 Michal Suchanek <hramrach / centrum.cz>:

> == is meaningless with floats.
>
> The previous issue ( the value before the excluded end of the range
> not being reached) was most likely the result of guarding against
> this:
>
> (1.0...128.4).step(18.2).to_a
> => [1.0, 19.2, 37.4, 55.599999999999994, 73.8, 92.0, 110.19999999999999, 128.4]
>
> I am quite sure that the 128.4 are not the same.

% ./ruby -ve 'p((1.0...128.4).step(18.2).to_a.last == 128.4)'
ruby 1.9.4dev (2011-09-16 trunk 33286) [i686-linux]
true

Hm.  It is same value in my environment.

I feel this can be considered as a bug.

It is also possible to argue that this is not a bug because == is
meaningless with floats, though.
-- 
Tanaka Akira