Home > PHP > Function > GMP > gmp_prob_prime()

gmp_prob_prime()

gmp_prob_prime - Check if number is "probably prime"

Syntax

int gmp_prob_prime ()

Arguments

-

Description

The function uses Miller-Rabin's probabilistic test to check if a number is a prime.

Version

PHP 4.0.4, 5

Return value

If this function returns 0, a is definitely not prime. If it returns 1, then a is "probably" prime. If it returns 2, then a is surely prime.