diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-15 23:56:32 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-15 23:56:32 +0000 |
commit | d631642a2ef3e86b0d3764df4c881a286fd13ec9 (patch) | |
tree | 412f64ddea60f548b99b21cb31786c2283e62567 /bignum.c | |
parent | 00a95f15bc840814baeaec8d970acf998d70e273 (diff) | |
download | ruby-d631642a2ef3e86b0d3764df4c881a286fd13ec9.tar.gz |
* bignum.c (bigdivrem): Use a BDIGIT variable to store the return
value of bigdivrem_single.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -3951,12 +3951,12 @@ bary_divmod(BDIGIT *qds, long nq, BDIGIT *rds, long nr, BDIGIT *xds, long nx, BD MEMZERO(zds+nx, BDIGIT, nz-nx); if ((yds[ny-1] >> (BITSPERDIG-1)) & 1) { - /* digits_bigdivrem_multi_sub will not modify y. + /* bigdivrem_normal will not modify y. * So use yds directly. */ tds = yds; } else { - /* digits_bigdivrem_multi_sub will modify y. + /* bigdivrem_normal will modify y. * So use rds as a temporary buffer. */ MEMCPY(rds, yds, BDIGIT, ny); tds = rds; @@ -3986,7 +3986,6 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp) VALUE z, zz; VALUE tmpy = 0, tmpz = 0; BDIGIT *xds, *yds, *zds, *tds; - BDIGIT_DBL t2; BDIGIT dd; yds = BDIGITS(y); @@ -4006,9 +4005,9 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp) dd = yds[0]; z = bignew(nx, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y)); zds = BDIGITS(z); - t2 = bigdivrem_single(zds, xds, nx, dd); + dd = bigdivrem_single(zds, xds, nx, dd); if (modp) { - *modp = rb_uint2big((VALUE)t2); + *modp = rb_uint2big((VALUE)dd); RBIGNUM_SET_SIGN(*modp, RBIGNUM_SIGN(x)); } if (divp) *divp = z; |