* src/factor.c (prime_p): Use stdc_trailing_zero here too.
This doesn’t make much of a performance difference but
we might as well be consistent.
static bool ATTRIBUTE_PURE
prime_p (uintmax_t n)
{
- mp_bitcnt_t k;
bool is_prime;
uintmax_t a_prim, one, ni;
struct factors factors;
return true;
/* Precomputation for Miller-Rabin. */
- uintmax_t q = n - 1;
- for (k = 0; (q & 1) == 0; k++)
- q >>= 1;
+ int k = stdc_trailing_zeros (n - 1);
+ uintmax_t q = (n - 1) >> k;
uintmax_t a = 2;
binv (ni, n); /* ni <- 1/n mod B */