mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 02:18:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@210630 c90b9560-bf6c-de11-be94-00142212c4b1
66 lines
1.7 KiB
XML
66 lines
1.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.1 $ -->
|
|
<refentry id="function.gmp-nextprime">
|
|
<refnamediv>
|
|
<refname>gmp_nextprime</refname>
|
|
<refpurpose>Find next prime number</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>gmp_nextprime</methodname>
|
|
<methodparam><type>int</type><parameter>a</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Return next prime number greater than <parameter>a</parameter>.
|
|
</para>
|
|
<para>
|
|
This function uses a probabilistic algorithm to identify primes and
|
|
chances to get a composite number are extremely small.
|
|
</para>
|
|
<example>
|
|
<title><function>gmp_nextprime</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$prime1 = gmp_nextprime(10); // next prime number greater than 10
|
|
$prime2 = gmp_nextprime(-1000); // next prime number greater than -1000
|
|
|
|
echo gmp_strval($prime1) . "\n";
|
|
echo gmp_strval($prime2) . "\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
The printout of the above program is:
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
11
|
|
-997
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|