diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2016-12-29 00:37:21 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2016-12-29 00:37:21 +0100 |
commit | 68a29f31b42e95e4464797886f01e7f82e77d146 (patch) | |
tree | b64408ff8387b1d4a0652d09a88a8c8e685377bb /gen-bases.c | |
parent | 424bde6b2eef8575abec0d32f251a3c31fe1bfe1 (diff) | |
download | gmp-68a29f31b42e95e4464797886f01e7f82e77d146.tar.gz |
gen-bases.c: Generate power of 2 with setbit
Diffstat (limited to 'gen-bases.c')
-rw-r--r-- | gen-bases.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gen-bases.c b/gen-bases.c index bfaecfb24..006d4532e 100644 --- a/gen-bases.c +++ b/gen-bases.c @@ -109,13 +109,13 @@ mp_2logb (mpz_t r, int bi, int prec) mpz_t t, t2, two, b; int i; - mpz_init_set_ui (t, 1); - mpz_mul_2exp (t, t, prec+EXTRA); + mpz_init (t); + mpz_setbit (t, prec + EXTRA); mpz_init (t2); - mpz_init_set_ui (two, 2); - mpz_mul_2exp (two, two, prec+EXTRA); + mpz_init (two); + mpz_setbit (two, prec + EXTRA + 1); mpz_set_ui (r, 0); |