From 68a29f31b42e95e4464797886f01e7f82e77d146 Mon Sep 17 00:00:00 2001 From: Marco Bodrato Date: Thu, 29 Dec 2016 00:37:21 +0100 Subject: gen-bases.c: Generate power of 2 with setbit --- gen-bases.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gen-bases.c') 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); -- cgit v1.2.1