From: Konstantin Shabanov Date: 2010-09-04T01:33:33+09:00 Subject: [ruby-core:32042] [Ruby 1.9-Bug#3785][Open] unexpected Numeric#step behaviour Bug #3785: unexpected Numeric#step behaviour http://redmine.ruby-lang.org/issues/show/3785 Author: Konstantin Shabanov Status: Open, Priority: Normal Category: core, Target version: 1.9.2 ruby -v: ruby-1.9.2-head ruby-1.9.2-head > -0.5.step(0.5, 0.1) { |x| puts x } -0.5 -0.4 -0.3 -0.19999999999999996 -0.09999999999999998 0.0 0.10000000000000009 0.20000000000000007 0.30000000000000004 0.4 0.5 => -0.5 ------------------------------------------------- The same with 1.9.2-p0, but with 1.9.1-p429 and 1.8.7-p302: ------------------------------------------------- ruby-1.8.7-p302 > -0.5.step(0.5, 0.1) { |x| puts x } -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 => -0.5 ------------------------------------------------- ---------------------------------------- http://redmine.ruby-lang.org