summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
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;