summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
Diffstat (limited to 'range.c')
-rw-r--r--range.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/range.c b/range.c
index 5835d80c23..45ba78dcf7 100644
--- a/range.c
+++ b/range.c
@@ -306,6 +306,9 @@ range_step(int argc, VALUE *argv, VALUE range)
}
else {
rb_scan_args(argc, argv, "01", &step);
+ if (!rb_obj_is_kind_of(step, rb_cNumeric)) {
+ step = rb_to_int(step);
+ }
if (rb_funcall(step, '<', 1, INT2FIX(0))) {
rb_raise(rb_eArgError, "step can't be negative");
}