aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-22 04:54:42 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-22 04:54:42 +0000
commitcc56bdee405b6de918f60f9ac73433d84c04fde0 (patch)
tree7f64c0590c3e270fdab1e7dc8c20b847e8f831a0
parent18b520443cfdf145f3cd7fd22f192c04dc0da9fc (diff)
downloadruby-cc56bdee405b6de918f60f9ac73433d84c04fde0.tar.gz
Fix for r33811.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--numeric.c2
-rw-r--r--test/ruby/test_float.rb2
3 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fc661ac7d0..7435522e27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
Tue Nov 22 11:33:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (dupfd): argument of _osfhnd and so on should not
@@ -5,7 +7,7 @@ Tue Nov 22 11:33:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * bignum.c (): refix of r33536. Don't change behavior of Bignum#/.
+ * bignum.c (rb_big_divide): refix of r33536. Don't change behavior of Bignum#/.
[ruby-core:40429] [Bug #5490]
Tue Nov 22 10:46:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
diff --git a/numeric.c b/numeric.c
index c8616f5f73..53d85829bb 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1703,7 +1703,7 @@ ruby_float_step(VALUE from, VALUE to, VALUE step, int excl)
}
for (i=0; i<=n; i++) {
double d = i*unit+beg;
- if (end < d) d = end;
+ if (unit >= 0 ? end < d : d < end) d = end;
rb_yield(DBL2NUM(d));
}
}
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index d16384898d..1935cfdd52 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -520,6 +520,8 @@ class TestFloat < Test::Unit::TestCase
(1.0..12.7).step(1.3).each do |n|
assert_operator(n, :<=, 12.7)
end
+
+ assert_equal([5.0, 4.0, 3.0, 2.0], 5.0.step(1.5, -1).to_a)
end
def test_step_excl