summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
Diffstat (limited to 'range.c')
-rw-r--r--range.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/range.c b/range.c
index 7526324da7..864ca9fb28 100644
--- a/range.c
+++ b/range.c
@@ -273,6 +273,8 @@ step_i(i, arg)
return Qnil;
}
+extern int ruby_float_step _((VALUE from, VALUE to, VALUE step, int excl));
+
/*
* call-seq:
* rng.step(n=1) {| obj | block } => rng
@@ -343,6 +345,9 @@ range_step(argc, argv, range)
}
}
+ else if (ruby_float_step(b, e, step, EXCL(range))) {
+ /* done */
+ }
else if (rb_obj_is_kind_of(b, rb_cNumeric) ||
!NIL_P(rb_check_to_integer(b, "to_int")) ||
!NIL_P(rb_check_to_integer(e, "to_int"))) {