diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | range.c | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Fri May 2 14:10:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * range.c (range_step): step may be bignum. + Fri May 2 13:52:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * re.c (Init_Regexp): remove MatchData#select. [ruby-dev:34563] @@ -310,8 +310,11 @@ range_step(int argc, VALUE *argv, VALUE range) rb_scan_args(argc, argv, "01", &step); tmp = rb_check_to_integer(step, "to_int"); if (!NIL_P(tmp)) { + if (FIXNUM_P(tmp)) + unit = FIX2LONG(tmp); + else + unit = rb_cmpint(tmp, step, INT2FIX(0)); step = tmp; - unit = NUM2LONG(step); } else { tmp = rb_funcall(rb_funcall(b, '+', 1, step), '-', 1, b); |