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

WBOY
Release: 2023-08-25 10:30:02
forward
612 people have browsed it

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)
Copy after login

Parameters

  • n - GMP number.

Return

gmp_prob_prime() function returns the following value -

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

  • 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")
?>
Copy after login

Output

The following is the output -

2
Copy after login

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!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!