From: Michal Suchanek Date: 2011-09-13T20:12:02+09:00 Subject: [ruby-core:39513] Re: [Ruby 1.9 - Bug #4576] Range#step miss the last value, if end-exclusive and has float number On 13 September 2011 12:28, Urabe Shyouhei wrote: > (09/13/2011 06:56 PM), V��t Ondruch wrote: >> Can somebody please reopen this issue? Since the test suite fix is >> apparently wrong. > > Hi, maybe I'm too unfamiliar with this area, but can you explain a bit > closer about how the test is apparently wrong? ��It seems OK to me. I see no error: irb(main):001:0> p (1.0...6.8).step(1.9).to_a [1.0, 2.9, 4.8, 6.7] => nil irb(main):002:0> p (1.0...6.6).step(1.9).to_a [1.0, 2.9, 4.8] => nil irb(main):003:0> p (1...6.3).step.to_a [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] => nil irb(main):004:0> p (1.1...6).step.to_a [1.1, 2.1, 3.1, 4.1, 5.1] => nil irb(main):005:0> p (1...6).step(1.1).to_a [1.0, 2.1, 3.2, 4.3, 5.4] => nil ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] irb(main):002:0> p (1.0...6.8).step(1.9).to_a [1.0, 2.9, 4.8, 6.699999999999999] => [1.0, 2.9, 4.8, 6.699999999999999] irb(main):003:0> p (1.0...6.6).step(1.9).to_a [1.0, 2.9, 4.8] => [1.0, 2.9, 4.8] irb(main):004:0> p (1...6.3).step.to_a [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] => [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] irb(main):005:0> p (1.1...6).step.to_a [1.1, 2.1, 3.1, 4.1, 5.1] => [1.1, 2.1, 3.1, 4.1, 5.1] irb(main):006:0> p (1...6).step(1.1).to_a [1.0, 2.1, 3.2, 4.300000000000001, 5.4] => [1.0, 2.1, 3.2, 4.300000000000001, 5.4] ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] Thanks Michal