mini-gmp: mpz_congruent_p and mpz_probab_prime_p

Niels Möller nisse at
Thu Mar 6 18:07:44 UTC 2014

bodrato at writes:

> I agree with your analysis: with the suggested change the same answer is
> given. Earlier, at no extra cost, I say.
> The same comment applies to the current implementation in the main library.

I think there's some value in using precisely the same tests as in
standard text books, and that it's a very unlikely case that the number
under test is a power of the (more or less random) base. Doesn't matter
very much, but I think I'd slightly prefer the code as is.

I have checked it in now, slightly simplified compared to the latest patch I
mailed here.


Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

More information about the gmp-devel mailing list