* bignum.c (bigdivrem): Use nlz.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
392d7a797a
commit
db3b317ca7
@ -1,3 +1,7 @@
|
||||
Thu Jun 13 18:34:20 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (bigdivrem): Use nlz.
|
||||
|
||||
Thu Jun 13 14:51:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): check constant safe
|
||||
|
7
bignum.c
7
bignum.c
@ -3793,12 +3793,9 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
|
||||
if (nx==ny) zds[nx+1] = 0;
|
||||
while (!yds[ny-1]) ny--;
|
||||
|
||||
dd = 0;
|
||||
q = yds[ny-1];
|
||||
while ((q & (BDIGIT)(1UL<<(BITSPERDIG-1))) == 0) {
|
||||
q <<= 1UL;
|
||||
dd++;
|
||||
}
|
||||
dd = nlz(q);
|
||||
q <<= dd;
|
||||
if (dd) {
|
||||
yy = rb_big_clone(y);
|
||||
tds = BDIGITS(yy);
|
||||
|
Loading…
x
Reference in New Issue
Block a user