mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
range.c: step in bignum
* range.c (range_step): honor step in bignum addition. [Feature #12912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ad5a6aa790
commit
db885d0850
2 changed files with 5 additions and 2 deletions
2
range.c
2
range.c
|
@ -408,7 +408,7 @@ range_step(int argc, VALUE *argv, VALUE range)
|
|||
} while (FIXABLE(i));
|
||||
b = LONG2NUM(i);
|
||||
|
||||
for (;; b = rb_funcallv(b, id_succ, 0, 0))
|
||||
for (;; b = rb_big_plus(b, step))
|
||||
rb_yield(b);
|
||||
}
|
||||
else if (FIXNUM_P(b) && FIXNUM_P(e) && FIXNUM_P(step)) { /* fixnums are special */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue