Output The following is the output - 2"/> Output The following is the output - 2">

Home  >  Article  >  Backend Development  >  The gmp_prob_prime() function in PHP is a function used to determine whether a number is prime.

The gmp_prob_prime() function in PHP is a function used to determine whether a number is prime.

WBOY
WBOYforward
2023-08-25 10:29:06629browse

The gmp_prob_prime() function in PHP is a function used to determine whether a number is prime.

gmp_prob_prime() function checks whether the GMP number is prime.

Syntax

gmp_prob_prime($n)

Parameters

  • n - GMP number.

Return

gmp_prob_prime() function returns the following value -

  • If the number is definitely not prime, it is 0

    li>
  • 1 If the number is probably prime

  • 2 If the number is definitely prime.

Example

The following is an example -

<?php
   gmp_prob_prime("11")
?>

Output

The following is the output -

2

The above is the detailed content of The gmp_prob_prime() function in PHP is a function used to determine whether a number is prime.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete