зеркало из https://github.com/github/ruby.git
* bignum.c (bigdivrem): Use bignew when ny == 1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
f41b284fab
Коммит
48bfbb574e
|
@ -1,3 +1,7 @@
|
|||
Fri Jun 14 20:12:37 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (bigdivrem): Use bignew when ny == 1.
|
||||
|
||||
Fri Jun 14 18:52:51 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* compile.c (rb_iseq_compile_node): fix location of a `trace'
|
||||
|
|
5
bignum.c
5
bignum.c
|
@ -3777,15 +3777,14 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
|
|||
}
|
||||
if (ny == 1) {
|
||||
dd = yds[0];
|
||||
z = rb_big_clone(x);
|
||||
z = bignew(nx, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
|
||||
zds = BDIGITS(z);
|
||||
t2 = 0; i = nx;
|
||||
while (i--) {
|
||||
t2 = BIGUP(t2) + zds[i];
|
||||
t2 = BIGUP(t2) + xds[i];
|
||||
zds[i] = (BDIGIT)(t2 / dd);
|
||||
t2 %= dd;
|
||||
}
|
||||
RBIGNUM_SET_SIGN(z, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
|
||||
if (modp) {
|
||||
*modp = rb_uint2big((VALUE)t2);
|
||||
RBIGNUM_SET_SIGN(*modp, RBIGNUM_SIGN(x));
|
||||
|
|
Загрузка…
Ссылка в новой задаче