aboutsummaryrefslogtreecommitdiffstats
path: root/range.c
diff options
context:
space:
mode:
Diffstat (limited to 'range.c')
-rw-r--r--range.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/range.c b/range.c
index b49b1bd79c..a2c0e21860 100644
--- a/range.c
+++ b/range.c
@@ -816,7 +816,9 @@ range_size(VALUE range)
}
}
else if (NIL_P(b)) {
- return DBL2NUM(HUGE_VAL);
+ if (rb_obj_is_kind_of(e, rb_cNumeric)) {
+ return DBL2NUM(HUGE_VAL);
+ }
}
return Qnil;