diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2009-12-28 16:33:49 +0100 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2009-12-28 16:33:49 +0100 |
commit | c8e3713b3ff9ce41596c21b7a91e954eb3a145be (patch) | |
tree | 59b781d937205731180ff9adb4469639326c480a /mpz/aorsmul_i.c | |
parent | 2da4e1d48ab00b6bf530710877d67284b88ef0e8 (diff) | |
download | gmp-c8e3713b3ff9ce41596c21b7a91e954eb3a145be.tar.gz |
New public functions mpn_com and mpn_neg. (Were internal and with _n suffix.)
Diffstat (limited to 'mpz/aorsmul_i.c')
-rw-r--r-- | mpz/aorsmul_i.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mpz/aorsmul_i.c b/mpz/aorsmul_i.c index 1bc6f4768..b3c2efae4 100644 --- a/mpz/aorsmul_i.c +++ b/mpz/aorsmul_i.c @@ -47,7 +47,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ The final w will retain its sign, unless an underflow occurs in a submul of absolute values, in which case it's flipped. - If x has more limbs than w, then mpn_submul_1 followed by mpn_com_n is + If x has more limbs than w, then mpn_submul_1 followed by mpn_com is used. The alternative would be mpn_mul_1 into temporary space followed by mpn_sub_n. Avoiding temporary space seem good, and submul+com stands a chance of being faster since it involves only one set of carry @@ -144,7 +144,7 @@ mpz_aorsmul_1 (mpz_ptr w, mpz_srcptr x, mp_limb_t y, mp_size_t sub) /* Borrow out of w, take twos complement negative to get absolute value, flip sign of w. */ wp[new_wsize] = ~-cy; /* extra limb is 0-cy */ - mpn_com_n (wp, wp, new_wsize); + mpn_com (wp, wp, new_wsize); new_wsize++; MPN_INCR_U (wp, new_wsize, CNST_LIMB(1)); wsize_signed = -wsize_signed; @@ -158,7 +158,7 @@ mpz_aorsmul_1 (mpz_ptr w, mpz_srcptr x, mp_limb_t y, mp_size_t sub) mp_limb_t cy2; /* -(-cy*b^n + w-x*y) = (cy-1)*b^n + ~(w-x*y) + 1 */ - mpn_com_n (wp, wp, wsize); + mpn_com (wp, wp, wsize); cy += mpn_add_1 (wp, wp, wsize, CNST_LIMB(1)); cy -= 1; |