Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: gmp_nextprime - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

gmp_or" width="11" height="7"/> <gmp_neg
Last updated: Mon, 05 Feb 2007

view this page in

gmp_nextprime

(PHP 5 >= 5.2.0)

gmp_nextprime — 次の素数を見つける

説明

resource gmp_nextprime ( int a )

a より大きい次の素数を返します。

この関数は素数を識別するのに確率的アルゴリズムを使用します。 誤って合成数を取得してしまうことは、まずありません。

例 746. gmp_nextprime() の例

<?php
$prime1
= gmp_nextprime(10); // 10 より大きい次の素数
$prime2 = gmp_nextprime(-1000); // -1000 より大きい次の素数

echo gmp_strval($prime1) . "\n";
echo
gmp_strval($prime2) . "\n";
?>

上のプログラムの出力は、このようになります。


11
-997

     



add a note add a note User Contributed Notes
gmp_nextprime
There are no user contributed notes for this page.

gmp_or" width="11" height="7"/> <gmp_neg
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites