From ded94d1c8ca7b318aad0c92ca290d1b6b2f3814d Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 13 Oct 2010 19:17:49 +0000 Subject: * numeric.c (ruby_float_step): fix Numeric#step with infinity unit doesn't works well. [ruby-core:32779] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 9c82b20fe6..43d08d011d 100644 --- a/numeric.c +++ b/numeric.c @@ -1621,7 +1621,7 @@ ruby_float_step(VALUE from, VALUE to, VALUE step, int excl) long i; if (isinf(unit)) { - if (unit > 0) rb_yield(DBL2NUM(beg)); + if (unit > 0 ? beg <= end : beg >= end) rb_yield(DBL2NUM(beg)); } else { if (err>0.5) err=0.5; -- cgit v1.2.3