aboutsummaryrefslogtreecommitdiffstats
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 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));
}
}