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 634c2eb940..7d557db74f 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1447,7 +1447,7 @@ ruby_float_step(from, to, step, excl)
if (err>0.5) err=0.5;
n = floor(n + err);
- if (!excl) n++;
+ if (!excl || ((long)n)*unit+beg < end) n++;
for (i=0; i<n; i++) {
rb_yield(rb_float_new(i*unit+beg));
}