diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | gen-trialdivtab.c | 17 |
2 files changed, 4 insertions, 15 deletions
@@ -2,6 +2,8 @@ * configure.in (CALLING_CONVENTIONS_OBJS): Disable any use of assembly code whit the --disable-assembly option. + * mpz/oddfac_1.c: Use the ASSERT_CODE macro. + * gen-trialdivtab.c (mpz_log2): Use mpz_sizeinbase (., 2). 2012-06-23 Marc Glisse <marc.glisse@inria.fr> diff --git a/gen-trialdivtab.c b/gen-trialdivtab.c index 095166473..d87265ec4 100644 --- a/gen-trialdivtab.c +++ b/gen-trialdivtab.c @@ -2,7 +2,7 @@ Contributed to the GNU project by Torbjorn Granlund. -Copyright 2009 Free Software Foundation, Inc. +Copyright 2009, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -203,20 +203,7 @@ main (int argc, char *argv[]) unsigned long mpz_log2 (mpz_t x) { - mpz_t y; - unsigned long cnt; - - mpz_init (y); - mpz_set (y, x); - cnt = 0; - while (mpz_sgn (y) != 0) - { - mpz_tdiv_q_2exp (y, y, 1); - cnt++; - } - mpz_clear (y); - - return cnt; + return mpz_sgn (x) ? mpz_sizeinbase (x, 2) : 0; } void |