summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-13 19:17:49 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-13 19:17:49 +0000
commitded94d1c8ca7b318aad0c92ca290d1b6b2f3814d (patch)
tree8fd11b6fa8f8dde6d21c2ac5c4a6b13e12b7370c /numeric.c
parentb238a3f3fdb575749121f35bbf37bfc1baed050c (diff)
* 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
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c2
1 files changed, 1 insertions, 1 deletions
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;