summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 08:07:24 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 08:07:24 +0000
commit0672c5fc3212a7b423eb35f706ee75c72632a376 (patch)
tree7032a081de143c9510bd930a8bfbb2d979dd6279 /numeric.c
parent51f6ed8161442265448f5b6c462a3e442cf7fcb1 (diff)
merges r29490 from trunk into ruby_1_9_2.
-- * 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/branches/ruby_1_9_2@30045 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 1bb8d5c75c..6fb50a04e6 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1576,7 +1576,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;