=================================================================== RCS file: /home/cvs/OpenXM_contrib/gmp/mpz/Attic/divexact.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.3 diff -u -p -r1.1.1.2 -r1.1.1.3 --- OpenXM_contrib/gmp/mpz/Attic/divexact.c 2000/09/09 14:12:50 1.1.1.2 +++ OpenXM_contrib/gmp/mpz/Attic/divexact.c 2003/08/25 16:06:33 1.1.1.3 @@ -1,7 +1,7 @@ /* mpz_divexact -- finds quotient when known that quot * den == num && den != 0. -Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000 Free Software -Foundation, Inc. +Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002 Free +Software Foundation, Inc. This file is part of the GNU MP Library. @@ -36,14 +36,7 @@ MA 02111-1307, USA. */ #include "longlong.h" void -#if __STDC__ mpz_divexact (mpz_ptr quot, mpz_srcptr num, mpz_srcptr den) -#else -mpz_divexact (quot, num, den) - mpz_ptr quot; - mpz_srcptr num; - mpz_srcptr den; -#endif { mp_ptr qp, tp; mp_size_t qsize, tsize; @@ -74,7 +67,7 @@ mpz_divexact (quot, num, den) { if (dsize == 1) { - mpn_divmod_1 (qp, np, nsize, dp[0]); + MPN_DIVREM_OR_DIVEXACT_1 (qp, np, nsize, dp[0]); qsize -= qp[qsize - 1] == 0; quot->_mp_size = (num->_mp_size ^ den->_mp_size) >= 0 ? qsize : -qsize; return; @@ -109,14 +102,14 @@ mpz_divexact (quot, num, den) count_trailing_zeros (r, dp[0]); mpn_rshift (tp, dp, tsize, r); if (dsize > tsize) - tp[tsize - 1] |= dp[tsize] << (BITS_PER_MP_LIMB - r); + tp[tsize - 1] |= (dp[tsize] << (GMP_NUMB_BITS - r)) & GMP_NUMB_MASK; mpn_rshift (qp, np, qsize, r); if (nsize > qsize) - qp[qsize - 1] |= np[qsize] << (BITS_PER_MP_LIMB - r); + qp[qsize - 1] |= (np[qsize] << (GMP_NUMB_BITS - r)) & GMP_NUMB_MASK; } /* Now QUOT <-- QUOT/T. */ - mpn_bdivmod (qp, qp, qsize, tp, tsize, qsize * BITS_PER_MP_LIMB); + mpn_bdivmod (qp, qp, qsize, tp, tsize, qsize * GMP_NUMB_BITS); MPN_NORMALIZE (qp, qsize); quot->_mp_size = (num->_mp_size ^ den->_mp_size) >= 0 ? qsize : -qsize;