diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2016-12-29 00:36:26 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2016-12-29 00:36:26 +0100 |
commit | 424bde6b2eef8575abec0d32f251a3c31fe1bfe1 (patch) | |
tree | 54c6a7be682e240b22965a4f29ed7e471ec33a0b /bootstrap.c | |
parent | f3350273b6106e80855f8c99ee0b33bfb37c31ed (diff) | |
download | gmp-424bde6b2eef8575abec0d32f251a3c31fe1bfe1.tar.gz |
bootstrap.c: Generate power of 2 with setbit
Diffstat (limited to 'bootstrap.c')
-rw-r--r-- | bootstrap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bootstrap.c b/bootstrap.c index 11affac00..999178e01 100644 --- a/bootstrap.c +++ b/bootstrap.c @@ -96,8 +96,8 @@ mpz_preinv_invert (mpz_t inv, const mpz_t d, int numb_bits) norm = numb_bits - mpz_sizeinbase (d, 2); assert (norm >= 0); - mpz_init_set_ui (t, 1L); - mpz_mul_2exp (t, t, 2*numb_bits - norm); + mpz_init (t); + mpz_setbit (t, 2*numb_bits - norm); mpz_tdiv_q (inv, t, d); mpz_clrbit (inv, numb_bits); |