From 7cc5e60453498546b5b2b0daa44a466f0aa3d3d6 Mon Sep 17 00:00:00 2001 From: Torbjorn Granlund Date: Mon, 1 Jun 2009 16:08:58 +0200 Subject: Correctly handle multiplicity that does not fit an int. --- mpz/remove.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mpz/remove.c') diff --git a/mpz/remove.c b/mpz/remove.c index 1e5474bec..761d01ba8 100644 --- a/mpz/remove.c +++ b/mpz/remove.c @@ -23,7 +23,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ unsigned long int mpz_remove (mpz_ptr dest, mpz_srcptr src, mpz_srcptr f) { - mpz_t fpow[40]; /* inexhaustible...until year 2020 or so */ + mpz_t fpow[GMP_LIMB_BITS]; /* Really MP_SIZE_T_BITS */ mpz_t x, rem; unsigned long int pwr; int p; @@ -69,7 +69,7 @@ mpz_remove (mpz_ptr dest, mpz_srcptr src, mpz_srcptr f) mpz_set (dest, x); } - pwr = (1 << p) - 1; + pwr = (1L << p) - 1; mpz_clear (fpow[p]); -- cgit v1.2.1