From: Michal Suchanek Date: 2011-09-16T23:07:46+09:00 Subject: [ruby-core:39584] Re: [Ruby 1.9 - Bug #4576] Range#step miss the last value, if end-exclusive and has float number On 16 September 2011 15:49, Tanaka Akira wrote: > 2011/9/16 Marc-Andre Lafortune : > >> Yes, floats can be complicated. No I wouldn't recommend to anyone to play with tight limits with floats. But here, it is simply not acceptable that `(foo...bar).step(baz).to_a.last == bar`. On any platform. This is not a question of learning floating point number. > > Interesting. > > Please show us an actual example of `(foo...bar).step(baz).to_a.last == bar` == 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. Still Ruby does not display the difference so the result is quite confusing. Thanks Michal