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 800d723df0..28704db389 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1445,7 +1445,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));
}