Computer >> Computer tutorials >  >> Programming >> PHP

gmp_prob_prime() function in PHP


The gmp_prob_prime() function checks for the possibility of a GMP number to be prime.

Syntax

gmp_prob_prime($n)

Parameters

  • n − A GMP number.

Return

The gmp_prob_prime() function returns the following values −

  • 0 if the number is definitely not prime

  • 1 if the number may be prime

  • 2 if the number is a prime for sure.

Example

The following is an example −

<?php
   gmp_prob_prime("11")
?>

Output

The following is the output −

2