Pike v8.1 release 6

Method Gmp.mpz()->probably_prime_p()


Method probably_prime_p

bool probably_prime_p(int count)

Description

Return 1 if this mpz object is a prime, and 0 most of the time if it is not.

Parameter count

The prime number testing is using Donald Knuth's probabilistic primality test. The chance for a false positive is pow(0.25,count). The higher value, the more probable it is that the number is a prime. Default value is 25.