Niels Möller nisse at
Thu Aug 22 08:32:13 UTC 2019

"Marco Bodrato" <bodrato at> writes:

> Currently tune/speed usually use the mean of many calls with the same input.
> Maybe for _nextprime we should use a chain? Give the previous result as
> the new input.

Makes sense to me.

> I know that my proposal is an incompatible change for the interface... but
> I'd suggest to extend the range for mpz_nextprime. Can we consider both
> positive and negative primes?

I think that's a bit unusual. We can compare with the corresponding
functions in pari/gp. These differ from gmp by nextprime(p) == p if p is
prime. And they don't consider negative numbers to be primes.


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

More information about the gmp-devel mailing list