From: Yusuke ENDOH Date: 2011-09-17T16:14:10+09:00 Subject: [ruby-core:39606] Re: [Ruby 1.9 - Bug #4576] Range#step miss the last value, if end-exclusive and has float number Hello, 2011/9/17 NARUSE, Yui : > In my current understanding, the error is > fabs(beg) * epsilon + fabs(unit) * epsilon * n + fabs(end) * epsilon > = (fabs(beg) + fabs(end) + fabs(end-beg)) * epsilon > // ignore error over unit*n -> end-beg > But the correct error may be less than it. I have no understanding of the error, but your patch does not work in this case: e = 1.0 + 1E-12 p (1.0 ... e).step(1E-16).all? {|n| n < e } #=> false p (1.0 ... e).step(1E-16).to_a.last == e #=> true -- Yusuke Endoh