mpz_nextprime

Paul Zimmermann Paul.Zimmermann at loria.fr
Mon May 11 13:05:08 CEST 2009


> Hi,
> 
> i'm studying on prime numbers with using GMP library. i'm searching how 
> mpz_nextprime(rop,op) is running. Which technique this is using?
> And Does this function give wrong number as prime? Is there anybody to help 
> me for my that problem?
> 
> Thanks. 

the behaviour of mpz_nextprime is best described in the source code...
Yes mpz_nextprime might return composite numbers.

Some additional information about the companion function mpz_probab_prime_p
can be found on http://www.trnicely.net/misc/mpzspsp.html (beware, it applies
to GMP 4.2.1, and might be out-of-date for GMP 4.3.0).

Paul Zimmermann


More information about the gmp-discuss mailing list