summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--range.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5968192b40..7cb03675c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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]
diff --git a/range.c b/range.c
index ae172be4e7..01524e15e0 100644
--- a/range.c
+++ b/range.c
@@ -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);