mini-gmp: mpz_congruent_p and mpz_probab_prime_p

bodrato at bodrato at
Fri Mar 7 18:27:17 UTC 2014


Il Gio, 6 Marzo 2014 7:07 pm, Niels ha scritto:
>> I agree with your analysis: with the suggested change the same answer is
>> given. Earlier, at no extra cost, I say.

> 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

Maybe it's valuable, but we don't. The text books typically suggest to
compute the GCD (base,number) before exponentiating. So that the case
"number under test is a power of the base" is not only "unlikely", but
excluded by the GCD step.

> 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.

Maybe the only case that benefit of the proposed "<=" is
mpz_probab_prime_p(41*41) :-D

> I have checked it in now, slightly simplified compared to the latest patch



More information about the gmp-devel mailing list