cvs: phpdoc /en language-snippets.ent /en/reference/gmp/functions gmp-abs.xml gmp-add.xml gmp-and.xml gmp-clrbit.xml gmp-cmp.xml gmp-com.xml
gmp-div-q.xml gmp-div-qr.xml gmp-div-r.xml gmp-div.xml gmp-divexact.xml gmp-fact.xml gmp-gcd.xml gmp-gcdext.xml gmp-hamdist.xml gmp-init.xml
gmp-intval.xml gmp-invert.xml gmp-jacobi.xml gmp-legendre.xml gmp-mod.xml gmp-mul.xml gmp-neg.xml gmp-nextprime.xml gmp-or.xml gmp-perfect-square.xml
gmp-popcount.xml gmp-pow.xml gmp-powm.xml gmp-prob-prime.xml gmp-random.xml gmp-scan0.xml gmp-scan1.xml gmp-setbit.xml gmp-sign.xml gmp-sqrt.xml
gmp-sqrtrem.xml gmp-strval.xml gmp-sub.xml gmp-testbit.xml gmp-xor.xml
| From: | Philip Olson | Date: | Sat, 21 Jul 2007 04:19:32 +0000 |
| Subject: | cvs: phpdoc /en language-snippets.ent /en/reference/gmp/functions gmp-abs.xml gmp-add.xml gmp-and.xml gmp-clrbit.xml gmp-cmp.xml gmp-com.xml gmp-div-q.xml gmp-div-qr.xml gmp-div-r.xml gmp-div.xml gmp-divexact.xml gmp-fact.xml gmp-gcd.xml gmp-gcdext.xml gmp-hamdist.xml gmp-init.xml gmp-intval.xml gmp-invert.xml gmp-jacobi.xml gmp-legendre.xml gmp-mod.xml gmp-mul.xml gmp-neg.xml gmp-nextprime.xml gmp-or.xml gmp-perfect-square.xml gmp-popcount.xml gmp-pow.xml gmp-powm.xml gmp-prob-prime.xml gmp-random.xml gmp-scan0.xml gmp-scan1.xml gmp-setbit.xml gmp-sign.xml gmp-sqrt.xml gmp-sqrtrem.xml gmp-strval.xml gmp-sub.xml gmp-testbit.xml gmp-xor.xml |
||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969377087@lists.php.net to get a copy of this message | ||
philip Sat Jul 21 04:19:32 2007 UTC
Modified files:
/phpdoc/en/reference/gmp/functions gmp-abs.xml gmp-add.xml
gmp-and.xml gmp-clrbit.xml
gmp-cmp.xml gmp-com.xml
gmp-div-q.xml gmp-div-qr.xml
gmp-div-r.xml gmp-div.xml
gmp-divexact.xml gmp-fact.xml
gmp-gcd.xml gmp-gcdext.xml
gmp-hamdist.xml gmp-init.xml
gmp-intval.xml gmp-invert.xml
gmp-jacobi.xml gmp-legendre.xml
gmp-mod.xml gmp-mul.xml
gmp-neg.xml gmp-nextprime.xml
gmp-or.xml
gmp-perfect-square.xml
gmp-popcount.xml gmp-pow.xml
gmp-powm.xml gmp-prob-prime.xml
gmp-random.xml gmp-scan0.xml
gmp-scan1.xml gmp-setbit.xml
gmp-sign.xml gmp-sqrt.xml
gmp-sqrtrem.xml gmp-strval.xml
gmp-sub.xml gmp-testbit.xml
gmp-xor.xml
/phpdoc/en language-snippets.ent
Log:
ref.gmp: Implemented the new doc style, new entities, and rewording where appropriate.
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-abs.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-abs.xml diff -u phpdoc/en/reference/gmp/functions/gmp-abs.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-abs.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-abs.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-abs.xml Sat Jul 21 04:19:31 2007 @@ -1,23 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-abs"> <refnamediv> <refname>gmp_abs</refname> <refpurpose>Absolute value</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_abs</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - Returns absolute value of <parameter>a</parameter>. + Get the absolute value of a number. </para> - <example> - <title><function>gmp_abs</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the absolute value of <parameter>a</parameter>, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_abs</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $abs1 = gmp_abs("274982683358"); @@ -27,17 +53,16 @@ echo gmp_strval($abs2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 274982683358 274982683358 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> </refentry> @@ -60,4 +85,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> +--> \ No newline at end of file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-add.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-add.xml diff -u phpdoc/en/reference/gmp/functions/gmp-add.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-add.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-add.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-add.xml Sat Jul 21 04:19:31 2007 @@ -1,42 +1,79 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-add"> <refnamediv> <refname>gmp_add</refname> <refpurpose>Add numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_add</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> - Add two GMP numbers. The result will be a GMP number representing - the sum of the arguments. + Add two numbers. </para> - <example> - <title><function>gmp_add</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + A number that will be added. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + <para> + A number that will be added. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A GMP number representing the sum of the arguments. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_add</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $sum = gmp_add("123456789012345", "76543210987655"); echo gmp_strval($sum) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 200000000000000 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-and.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-and.xml diff -u phpdoc/en/reference/gmp/functions/gmp-and.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-and.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-and.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-and.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-and"> <refnamediv> <refname>gmp_and</refname> <refpurpose>Logical AND</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_and</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,6 +16,37 @@ <para> Calculates logical AND of two GMP numbers. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A GMP number representing the logical <literal>AND</literal> comparison. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <example> <title><function>gmp_and</function> example</title> <programlisting role="php"> @@ -28,9 +59,7 @@ ?> ]]> </programlisting> - <para> - The printout of the above program will be: - </para> + &example.outputs; <screen> <![CDATA[ 4 @@ -39,6 +68,7 @@ </screen> </example> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-clrbit.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-clrbit.xml diff -u phpdoc/en/reference/gmp/functions/gmp-clrbit.xml:1.10 phpdoc/en/reference/gmp/functions/gmp-clrbit.xml:1.11 --- phpdoc/en/reference/gmp/functions/gmp-clrbit.xml:1.10 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-clrbit.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.11 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-clrbit"> <refnamediv> <refname>gmp_clrbit</refname> <refpurpose>Clear bit</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>void</type><methodname>gmp_clrbit</methodname> <methodparam><type>resource</type><parameter role="reference">a</parameter></methodparam> @@ -17,14 +17,37 @@ Clears (sets to 0) bit <parameter>index</parameter> in <parameter>a</parameter>. The index starts at 0. </para> - <note> - <para> - Unlike most of the other GMP functions, <function>gmp_clrbit</function> - must be called with a GMP resource that already exists (using - <function>gmp_init</function> for example). One will not be - automatically created. - </para> - </note> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>index</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <example> <title><function>gmp_clrbit</function> example</title> <programlisting role="php"> @@ -36,20 +59,37 @@ ?> ]]> </programlisting> - <para> - The printout of the above program will be: - </para> + &example.outputs; <screen> <![CDATA[ 254 ]]> </screen> </example> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + Unlike most of the other GMP functions, <function>gmp_clrbit</function> + must be called with a GMP resource that already exists (using + <function>gmp_init</function> for example). One will not be + automatically created. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_setbit</function> and - <function>gmp_testbit</function>. + <simplelist> + <member><function>gmp_setbit</function></member> + <member><function>gmp_testbit</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-cmp.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-cmp.xml diff -u phpdoc/en/reference/gmp/functions/gmp-cmp.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-cmp.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-cmp.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-cmp.xml Sat Jul 21 04:19:31 2007 @@ -1,23 +1,54 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-cmp"> <refnamediv> <refname>gmp_cmp</refname> <refpurpose>Compare numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_cmp</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> + Compares two numbers. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> Returns a positive value if <literal>a > b</literal>, zero if <literal>a = b</literal> and a negative value if <literal>a < b</literal>. </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <example> <title><function>gmp_cmp</function> example</title> <programlisting role="php"> @@ -31,9 +62,7 @@ ?> ]]> </programlisting> - <para> - The printout of the above program will be: - </para> + &example.outputs; <screen> <![CDATA[ 1 -1 0 @@ -41,6 +70,7 @@ </screen> </example> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-com.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-com.xml diff -u phpdoc/en/reference/gmp/functions/gmp-com.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-com.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-com.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-com.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.20 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id='function.gmp-com'> <refnamediv> <refname>gmp_com</refname> <refpurpose>Calculates one's complement</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_com</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -15,6 +15,31 @@ <para> Returns the one's complement of <parameter>a</parameter>. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the one's complement of <parameter>a</parameter>, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <example> <title><function>gmp_com</function> example</title> <programlisting role="php"> @@ -25,17 +50,15 @@ ?> ]]> </programlisting> - <para> - The printout of the above program will be: - </para> + &example.outputs; <screen> <![CDATA[ -1235 ]]> </screen> </example> - </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-div-q.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-div-q.xml diff -u phpdoc/en/reference/gmp/functions/gmp-div-q.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-div-q.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-div-q.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-div-q.xml Sat Jul 21 04:19:31 2007 @@ -1,51 +1,95 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-div-q"> <refnamediv> <refname>gmp_div_q</refname> <refpurpose>Divide numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_div_q</methodname> - <methodparam><type>resource</type><parameter>a</parameter></methodparam> - <methodparam><type>resource</type><parameter>b</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>round</parameter></methodparam> + <methodparam><type>resource</type><parameter>a</parameter></methodparam> + <methodparam><type>resource</type><parameter>b</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>round</parameter></methodparam> </methodsynopsis> <para> Divides <parameter>a</parameter> by <parameter>b</parameter> and - returns the integer result. The result rounding is defined by the - <parameter>round</parameter>, which can have the following - values: - <itemizedlist> - <listitem> - <simpara> - <parameter>GMP_ROUND_ZERO</parameter>: The result is truncated - towards 0. - </simpara> - </listitem> - <listitem> - <simpara> - <parameter>GMP_ROUND_PLUSINF</parameter>: The result is - rounded towards <literal>+infinity</literal>. - </simpara> - </listitem> - <listitem> - <simpara> - <parameter>GMP_ROUND_MINUSINF</parameter>: The result is - rounded towards <literal>-infinity</literal>. - </simpara> - </listitem> - </itemizedlist> + returns the integer result. </para> - <simpara> - This function can also be called as <function>gmp_div</function>. - </simpara> - <example> - <title><function>gmp_div_q</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being divided. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + <para> + The number that <parameter>a</parameter> is being divided by. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>round</parameter></term> + <listitem> + <para> + The result rounding is defined by the + <parameter>round</parameter>, which can have the following + values: + <itemizedlist> + <listitem> + <simpara> + <constant>GMP_ROUND_ZERO</constant>: The result is truncated + towards 0. + </simpara> + </listitem> + <listitem> + <simpara> + <constant>GMP_ROUND_PLUSINF</constant>: The result is + rounded towards <literal>+infinity</literal>. + </simpara> + </listitem> + <listitem> + <simpara> + <constant>GMP_ROUND_MINUSINF</constant>: The result is + rounded towards <literal>-infinity</literal>. + </simpara> + </listitem> + </itemizedlist> + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_div_q</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $div1 = gmp_div_q("100", "5"); @@ -64,11 +108,9 @@ echo gmp_strval($div5) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 20 0 @@ -76,13 +118,30 @@ 0 -1 ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + This function can also be called as <function>gmp_div</function>. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_div_r</function>, - <function>gmp_div_qr</function> + <simplelist> + <member><function>gmp_div_r</function></member> + <member><function>gmp_div_qr</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-div-qr.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-div-qr.xml diff -u phpdoc/en/reference/gmp/functions/gmp-div-qr.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-div-qr.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-div-qr.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-div-qr.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-div-qr"> <refnamediv> <refname>gmp_div_qr</refname> <refpurpose>Divide numbers and get quotient and remainder</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>gmp_div_qr</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> @@ -15,16 +15,57 @@ <methodparam choice="opt"><type>int</type><parameter>round</parameter></methodparam> </methodsynopsis> <para> - The function divides <parameter>n</parameter> by - <parameter>d</parameter> and returns array, with the first + The function divides <parameter>n</parameter> by <parameter>d</parameter>. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>n</parameter></term> + <listitem> + <para> + The number being divided. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>d</parameter></term> + <listitem> + <para> + The number that <parameter>n</parameter> is being divided by. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>round</parameter></term> + <listitem> + <para> + See the <function>gmp_div_q</function> function for description + of the <parameter>round</parameter> argument. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns an <type>array</type>, with the first element being <literal>[n/d]</literal> (the integer result of the division) and the second being <literal>(n - [n/d] * d)</literal> (the remainder of the division). </para> - <para> - See the <function>gmp_div_q</function> function for description - of the <parameter>round</parameter> argument. - </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title>Division of GMP numbers</title> @@ -40,9 +81,15 @@ </programlisting> </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_div_q</function>, - <function>gmp_div_r</function>. + <simplelist> + <member><function>gmp_div_q</function></member> + <member><function>gmp_div_r</function></member> + </simplelist> </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-div-r.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-div-r.xml diff -u phpdoc/en/reference/gmp/functions/gmp-div-r.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-div-r.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-div-r.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-div-r.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-div-r"> <refnamediv> <refname>gmp_div_r</refname> <refpurpose>Remainder of the division of numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_div_r</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> @@ -20,34 +20,83 @@ remainder has the sign of the <parameter>n</parameter> argument, if not zero. </para> - <example> - <title><function>gmp_div_r</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>n</parameter></term> + <listitem> + <para> + The number being divided. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>d</parameter></term> + <listitem> + <para> + The number that <parameter>n</parameter> is being divided by. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>round</parameter></term> + <listitem> + <para> + See the <function>gmp_div_q</function> function for description + of the <parameter>round</parameter> argument. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The remainder, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_div_r</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $div = gmp_div_r("105", "20"); echo gmp_strval($div) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 5 ]]> - </screen> - </example> - <para> - See the <function>gmp_div_q</function> function for description - of the <parameter>round</parameter> argument. + </screen> + </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_div_q</function>, - <function>gmp_div_qr</function> + <simplelist> + <member><function>gmp_div_q</function></member> + <member><function>gmp_div_qr</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-div.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-div.xml diff -u phpdoc/en/reference/gmp/functions/gmp-div.xml:1.5 phpdoc/en/reference/gmp/functions/gmp-div.xml:1.6 --- phpdoc/en/reference/gmp/functions/gmp-div.xml:1.5 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-div.xml Sat Jul 21 04:19:31 2007 @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.6 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-div"> <refnamediv> <refname>gmp_div</refname> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-divexact.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-divexact.xml diff -u phpdoc/en/reference/gmp/functions/gmp-divexact.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-divexact.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-divexact.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-divexact.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-divexact"> <refnamediv> <refname>gmp_divexact</refname> <refpurpose>Exact division of numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_divexact</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> @@ -19,9 +19,47 @@ correct results only when it is known in advance that <parameter>d</parameter> divides <parameter>n</parameter>. </para> - <example> - <title><function>gmp_divexact</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>n</parameter></term> + <listitem> + <para> + The number being divided. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>d</parameter></term> + <listitem> + <para> + The number that <parameter>a</parameter> is being divided by. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_divexact</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $div1 = gmp_divexact("10", "2"); @@ -31,18 +69,18 @@ echo gmp_strval($div2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 5 2863311534 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-fact.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-fact.xml diff -u phpdoc/en/reference/gmp/functions/gmp-fact.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-fact.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-fact.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-fact.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-fact"> <refnamediv> <refname>gmp_fact</refname> <refpurpose>Factorial</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_fact</methodname> <methodparam><type>int</type><parameter>a</parameter></methodparam> @@ -15,9 +15,38 @@ <para> Calculates factorial (<literal>a!</literal>) of <parameter>a</parameter>. </para> - <example> - <title><function>gmp_fact</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The factorial number. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_fact</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $fact1 = gmp_fact(5); // 5 * 4 * 3 * 2 * 1 @@ -27,18 +56,18 @@ echo gmp_strval($fact2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 120 30414093201713378043612608166064768844377641568960512000000000000 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-gcd.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-gcd.xml diff -u phpdoc/en/reference/gmp/functions/gmp-gcd.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-gcd.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-gcd.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-gcd.xml Sat Jul 21 04:19:32 2007 @@ -1,43 +1,76 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-gcd"> <refnamediv> <refname>gmp_gcd</refname> <refpurpose>Calculate GCD</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_gcd</methodname> - <methodparam><type>resource</type><parameter>a</parameter></methodparam> - <methodparam><type>resource</type><parameter>b</parameter></methodparam> + <methodparam><type>resource</type><parameter>a</parameter></methodparam> + <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> Calculate greatest common divisor of <parameter>a</parameter> and <parameter>b</parameter>. The result is always positive even if either of, or both, input operands are negative. </para> - <example> - <title><function>gmp_gcd</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A positive GMP number that divides into both + <parameter>a</parameter> and <parameter>b</parameter>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_gcd</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $gcd = gmp_gcd("12", "21"); echo gmp_strval($gcd) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-gcdext.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-gcdext.xml diff -u phpdoc/en/reference/gmp/functions/gmp-gcdext.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-gcdext.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-gcdext.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-gcdext.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-gcdext"> <refnamediv> <refname>gmp_gcdext</refname> <refpurpose>Calculate GCD and multipliers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>gmp_gcdext</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -22,9 +22,40 @@ This function can be used to solve linear Diophantine equations in two variables. These are equations that allow only integer solutions and have the form: <literal>a*x + b*y = c</literal>. - For more information, go to the <link xlink:href="&url.diophantine-equation;">"Diophantine - Equation" page at MathWorld</link> + For more information, go to the <link xlink:href="&url.diophantine-equation;">"Diophantine + Equation" page at MathWorld</link> </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + An <type>array</type> of GMP numbers. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title>Solving a linear Diophantine equation</title> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-hamdist.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-hamdist.xml diff -u phpdoc/en/reference/gmp/functions/gmp-hamdist.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-hamdist.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-hamdist.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-hamdist.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-hamdist"> <refnamediv> <refname>gmp_hamdist</refname> <refpurpose>Hamming distance</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_hamdist</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -17,9 +17,47 @@ Returns the hamming distance between <parameter>a</parameter> and <parameter>b</parameter>. Both operands should be non-negative. </para> - <example> - <title><function>gmp_hamdist</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + <para> + It should be positive. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + <para> + It should be positive. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_hamdist</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $ham1 = gmp_init("1001010011", 2); @@ -30,22 +68,28 @@ echo gmp_popcount(gmp_xor($ham1, $ham2)) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 6 6 ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_popcount</function>, - <function>gmp_xor</function> + <simplelist> + <member><function>gmp_popcount</function></member> + <member><function>gmp_xor</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-init.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-init.xml diff -u phpdoc/en/reference/gmp/functions/gmp-init.xml:1.8 phpdoc/en/reference/gmp/functions/gmp-init.xml:1.9 --- phpdoc/en/reference/gmp/functions/gmp-init.xml:1.8 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-init.xml Sat Jul 21 04:19:32 2007 @@ -1,31 +1,88 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.9 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-init"> <refnamediv> <refname>gmp_init</refname> <refpurpose>Create GMP number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_init</methodname> <methodparam><type>mixed</type><parameter>number</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> </methodsynopsis> <para> - Creates a GMP number from an integer or string. String - representation can be decimal, hexadecimal or octal. - Optional parameter <parameter>base</parameter> is available since - PHP 4.1.0. Its default value is <literal>0</literal>. + Creates a GMP number from an integer or string. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; <para> - The base may vary from 2 to 36. If base is 0 (default value), the - actual base is determined from the leading characters: if the first - two characters are <literal>0x</literal> or <literal>0X</literal>, - hexadecimal is assumed, otherwise if the first character is "0", - octal is assumed, otherwise decimal is assumed. + <variablelist> + <varlistentry> + <term><parameter>number</parameter></term> + <listitem> + <para> + An integer or a string. The string representation can be decimal, + hexadecimal or octal. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + The base. Defaults to 0. + </para> + <para> + The base may vary from 2 to 36. If base is 0 (default value), the + actual base is determined from the leading characters: if the first + two characters are <literal>0x</literal> or <literal>0X</literal>, + hexadecimal is assumed, otherwise if the first character is "0", + octal is assumed, otherwise decimal is assumed. + </para> + </listitem> + </varlistentry> + </variablelist> </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>4.1.0</entry> + <entry> + The optional <parameter>base</parameter> parameter was added. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title>Creating GMP number</title> @@ -39,7 +96,10 @@ </programlisting> </example> </para> + </refsect1> + <refsect1 role="notes"> + &reftitle.notes; <note> <para> It is not necessary to call this function if you want to use @@ -51,6 +111,7 @@ </para> </note> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-intval.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-intval.xml diff -u phpdoc/en/reference/gmp/functions/gmp-intval.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-intval.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-intval.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-intval.xml Sat Jul 21 04:19:32 2007 @@ -1,30 +1,51 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-intval"> <refnamediv> <refname>gmp_intval</refname> <refpurpose>Convert GMP number to integer</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_intval</methodname> <methodparam><type>resource</type><parameter>gmpnumber</parameter></methodparam> </methodsynopsis> <para> This function allows to convert GMP number to integer. - <warning> - <simpara> - This function returns a useful result only if the number actually - fits the PHP integer (i.e., signed long type). If you want just - to print the GMP number, use <function>gmp_strval</function>. - </simpara> - </warning> </para> - <example> - <title><function>gmp_intval</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>gmpnumber</parameter></term> + <listitem> + <para> + A GMP number. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + An <type>integer</type> value of <parameter>gmpnumber</parameter>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_intval</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // displays correct result @@ -37,19 +58,30 @@ echo gmp_strval("2147483648") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 2147483647 2147483647 2147483648 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <warning> + <simpara> + This function returns a useful result only if the number actually + fits the PHP integer (i.e., signed long type). If you want just + to print the GMP number, use <function>gmp_strval</function>. + </simpara> + </warning> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-invert.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-invert.xml diff -u phpdoc/en/reference/gmp/functions/gmp-invert.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-invert.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-invert.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-invert.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-invert"> <refnamediv> <refname>gmp_invert</refname> <refpurpose>Inverse by modulo</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_invert</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -15,12 +15,43 @@ </methodsynopsis> <para> Computes the inverse of <parameter>a</parameter> modulo - <parameter>b</parameter>. Returns &false; if an inverse does not - exist. + <parameter>b</parameter>. </para> - <example> - <title><function>gmp_invert</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A GMP number on success or &false; if an inverse does not exist. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_invert</function> example</title> + <programlisting role="php"> <![CDATA[ <?php echo gmp_invert("5", "10"); // no inverse, outputs nothing, result is FALSE @@ -28,17 +59,17 @@ echo gmp_strval($invert) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 9 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-jacobi.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-jacobi.xml diff -u phpdoc/en/reference/gmp/functions/gmp-jacobi.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-jacobi.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-jacobi.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-jacobi.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-jacobi"> <refnamediv> <refname>gmp_jacobi</refname> <refpurpose>Jacobi symbol</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_jacobi</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -15,32 +15,66 @@ </methodsynopsis> <para> Computes - <link xlink:href="&url.jacobi;"> - Jacobi symbol</link> of <parameter>a</parameter> and + <link xlink:href="&url.jacobi;">Jacobi symbol</link> of <parameter>a</parameter> and <parameter>p</parameter>. <parameter>p</parameter> should be odd and must be positive. </para> - <example> - <title><function>gmp_jacobi</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>p</parameter></term> + <listitem> + &gmp.parameter; + <para> + Should be odd and must be positive. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_jacobi</function> example</title> + <programlisting role="php"> <![CDATA[ <?php echo gmp_jacobi("1", "3") . "\n"; echo gmp_jacobi("2", "3") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1 0 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-legendre.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-legendre.xml diff -u phpdoc/en/reference/gmp/functions/gmp-legendre.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-legendre.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-legendre.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-legendre.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-legendre"> <refnamediv> <refname>gmp_legendre</refname> <refpurpose>Legendre symbol</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_legendre</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -20,27 +20,62 @@ <parameter>p</parameter>. <parameter>p</parameter> should be odd and must be positive. </para> - <example> - <title><function>gmp_legendre</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>p</parameter></term> + <listitem> + &gmp.parameter; + <para> + Should be odd and must be positive. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_legendre</function> example</title> + <programlisting role="php"> <![CDATA[ <?php echo gmp_legendre("1", "3") . "\n"; echo gmp_legendre("2", "3") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1 0 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-mod.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-mod.xml diff -u phpdoc/en/reference/gmp/functions/gmp-mod.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-mod.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-mod.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-mod.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-mod"> <refnamediv> <refname>gmp_mod</refname> <refpurpose>Modulo operation</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_mod</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> @@ -18,26 +18,61 @@ <parameter>d</parameter>. The result is always non-negative, the sign of <parameter>d</parameter> is ignored. </para> - <example> - <title><function>gmp_mod</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>n</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>d</parameter></term> + <listitem> + <para> + The modulo that is being evaluated. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_mod</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $mod = gmp_mod("8", "3"); echo gmp_strval($mod) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 2 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-mul.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-mul.xml diff -u phpdoc/en/reference/gmp/functions/gmp-mul.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-mul.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-mul.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-mul.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-mul"> <refnamediv> <refname>gmp_mul</refname> <refpurpose>Multiply numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_mul</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -17,26 +17,64 @@ Multiplies <parameter>a</parameter> by <parameter>b</parameter> and returns the result. </para> - <example> - <title><function>gmp_mul</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + A number that will be multiplied by <parameter>b</parameter>. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + <para> + A number that will be multiplied by <parameter>a</parameter>. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_mul</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $mul = gmp_mul("12345678", "2000"); echo gmp_strval($mul) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 24691356000 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-neg.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-neg.xml diff -u phpdoc/en/reference/gmp/functions/gmp-neg.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-neg.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-neg.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-neg.xml Sat Jul 21 04:19:32 2007 @@ -1,23 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-neg"> <refnamediv> <refname>gmp_neg</refname> <refpurpose>Negate number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_neg</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - Returns -<parameter>a</parameter>. + Returns the negative value of a number. </para> - <example> - <title><function>gmp_neg</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns -<parameter>a</parameter>, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_neg</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $neg1 = gmp_neg("1"); @@ -26,18 +52,18 @@ echo gmp_strval($neg2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ -1 1 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-nextprime.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-nextprime.xml diff -u phpdoc/en/reference/gmp/functions/gmp-nextprime.xml:1.3 phpdoc/en/reference/gmp/functions/gmp-nextprime.xml:1.4 --- phpdoc/en/reference/gmp/functions/gmp-nextprime.xml:1.3 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-nextprime.xml Sat Jul 21 04:19:32 2007 @@ -1,26 +1,50 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-nextprime"> <refnamediv> <refname>gmp_nextprime</refname> <refpurpose>Find next prime number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <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>. + Find next prime number </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; <para> - This function uses a probabilistic algorithm to identify primes and - chances to get a composite number are extremely small. + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> </para> - <example> - <title><function>gmp_nextprime</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Return the next prime number greater than <parameter>a</parameter>, + as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_nextprime</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $prime1 = gmp_nextprime(10); // next prime number greater than 10 @@ -30,18 +54,28 @@ echo gmp_strval($prime2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program is: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 11 -997 ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + This function uses a probabilistic algorithm to identify primes and + chances to get a composite number are extremely small. + </para> + </note> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-or.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-or.xml diff -u phpdoc/en/reference/gmp/functions/gmp-or.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-or.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-or.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-or.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-or"> <refnamediv> <refname>gmp_or</refname> <refpurpose>Logical OR</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_or</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,9 +16,41 @@ <para> Calculates logical inclusive OR of two GMP numbers. </para> - <example> - <title><function>gmp_or</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_or</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $or1 = gmp_or("0xfffffff2", "4"); @@ -27,18 +59,18 @@ echo gmp_strval($or2, 16) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ fffffff6 fffffff2 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml diff -u phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml Sat Jul 21 04:19:32 2007 @@ -1,24 +1,53 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-perfect-square"> <refnamediv> <refname>gmp_perfect_square</refname> <refpurpose>Perfect square check</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>bool</type><methodname>gmp_perfect_square</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> + Check if a number is a perfect square. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being checked as a perfect square. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> Returns &true; if <parameter>a</parameter> is a perfect square, &false; otherwise. </para> - <example> - <title><function>gmp_perfect_square</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_perfect_square</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // 3 * 3, perfect square @@ -31,23 +60,29 @@ var_dump(gmp_perfect_square("1524157875019052100")); ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ bool(true) bool(false) bool(true) ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also: <function>gmp_sqrt</function>, - <function>gmp_sqrtrem</function>. + <simplelist> + <member><function>gmp_sqrt</function></member> + <member><function>gmp_sqrtrem</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-popcount.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-popcount.xml diff -u phpdoc/en/reference/gmp/functions/gmp-popcount.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-popcount.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-popcount.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-popcount.xml Sat Jul 21 04:19:32 2007 @@ -1,23 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-popcount"> <refnamediv> <refname>gmp_popcount</refname> <refpurpose>Population count</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_popcount</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - Return the population count of <parameter>a</parameter>. + Get the population count. </para> - <example> - <title><function>gmp_popcount</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The population count of <parameter>a</parameter>, as an <type>integer</type>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_popcount</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $pop1 = gmp_init("10000101", 2); // 3 1's @@ -26,18 +52,18 @@ echo gmp_popcount($pop2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 7 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-pow.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-pow.xml diff -u phpdoc/en/reference/gmp/functions/gmp-pow.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-pow.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-pow.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-pow.xml Sat Jul 21 04:19:32 2007 @@ -1,26 +1,62 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-pow"> <refnamediv> <refname>gmp_pow</refname> <refpurpose>Raise number into power</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_pow</methodname> <methodparam><type>resource</type><parameter>base</parameter></methodparam> <methodparam><type>int</type><parameter>exp</parameter></methodparam> </methodsynopsis> <para> - Raise <parameter>base</parameter> into power - <parameter>exp</parameter>. The case of 0^0 yields - 1. <parameter>exp</parameter> cannot be negative. + Raise <parameter>base</parameter> into power <parameter>exp</parameter>. </para> - <example> - <title><function>gmp_pow</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + The base number. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>exp</parameter></term> + <listitem> + <para> + The positive power to raise the <parameter>base</parameter>. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The new (raised) number, as a GMP number. The case of + <literal>0^0</literal> yields 1. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_pow</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $pow1 = gmp_pow("2", 31); @@ -31,18 +67,18 @@ echo gmp_strval($pow3) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 2147483648 1 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-powm.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-powm.xml diff -u phpdoc/en/reference/gmp/functions/gmp-powm.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-powm.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-powm.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-powm.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-powm"> <refnamediv> <refname>gmp_powm</refname> <refpurpose>Raise number into power with modulo</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_powm</methodname> <methodparam><type>resource</type><parameter>base</parameter></methodparam> @@ -19,26 +19,74 @@ <parameter>exp</parameter>) modulo <parameter>mod</parameter>. If <parameter>exp</parameter> is negative, result is undefined. </para> - <example> - <title><function>gmp_powm</function> example</title> - <programlisting role="php"> + </refsect1> + + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + The base number. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>exp</parameter></term> + <listitem> + <para> + The positive power to raise the <parameter>base</parameter>. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>mod</parameter></term> + <listitem> + <para> + The modulo. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The new (raised) number, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_powm</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $pow1 = gmp_powm("2", "31", "2147483649"); echo gmp_strval($pow1) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 2147483648 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml diff -u phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml Sat Jul 21 04:19:32 2007 @@ -1,33 +1,68 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-prob-prime"> <refnamediv> <refname>gmp_prob_prime</refname> <refpurpose>Check if number is "probably prime"</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_prob_prime</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>reps</parameter></methodparam> </methodsynopsis> <para> + The function uses Miller-Rabin's probabilistic test to check if a number is a prime. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being checked as a prime. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>reps</parameter></term> + <listitem> + <para> + Reasonable values + of <parameter>reps</parameter> vary from 5 to 10 (default being + 10); a higher value lowers the probability for a non-prime to + pass as a "probable" prime. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> If this function returns 0, <parameter>a</parameter> is definitely not prime. If it returns 1, then <parameter>a</parameter> is "probably" prime. If it returns 2, - then <parameter>a</parameter> is surely prime. Reasonable values - of <parameter>reps</parameter> vary from 5 to 10 (default being - 10); a higher value lowers the probability for a non-prime to - pass as a "probable" prime. + then <parameter>a</parameter> is surely prime. </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> - The function uses Miller-Rabin's probabilistic test. - </para> - <example> - <title><function>gmp_prob_prime</function> example</title> - <programlisting role="php"> + <example> + <title><function>gmp_prob_prime</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // definitely not a prime @@ -40,19 +75,19 @@ echo gmp_prob_prime("11") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 0 1 2 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-random.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-random.xml diff -u phpdoc/en/reference/gmp/functions/gmp-random.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-random.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-random.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-random.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-random"> <refnamediv> <refname>gmp_random</refname> <refpurpose>Random number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_random</methodname> <methodparam><type>int</type><parameter>limiter</parameter></methodparam> @@ -23,9 +23,38 @@ not static, and can vary from system to system. Generally, the number of bits in a limb is either 16 or 32, but this is not guaranteed. </para> - <example> - <title><function>gmp_random</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>limiter</parameter></term> + <listitem> + <para> + The limiter. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A random GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_random</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $rand1 = gmp_random(1); // random number from 0 to 1 * bits per limb @@ -35,18 +64,18 @@ echo gmp_strval($rand2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program might be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1915834968 8642564075890328087 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-scan0.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-scan0.xml diff -u phpdoc/en/reference/gmp/functions/gmp-scan0.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-scan0.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-scan0.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-scan0.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-scan0"> <refnamediv> <refname>gmp_scan0</refname> <refpurpose>Scan for 0</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_scan0</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,12 +16,49 @@ <para> Scans <parameter>a</parameter>, starting with bit <parameter>start</parameter>, towards more significant bits, - until the first clear bit is found. Returns the index of the - found bit. The index starts from 0. + until the first clear bit is found. </para> - <example> - <title><function>gmp_scan0</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number to scan. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>start</parameter></term> + <listitem> + <para> + The starting bit. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the index of the found bit, as an <type>integer</type>. The + index starts from 0. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_scan0</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // "0" bit is found at position 3. index starts at 0 @@ -33,18 +70,18 @@ echo gmp_scan0($s2, 5) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 7 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-scan1.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-scan1.xml diff -u phpdoc/en/reference/gmp/functions/gmp-scan1.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-scan1.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-scan1.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-scan1.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-scan1"> <refnamediv> <refname>gmp_scan1</refname> <refpurpose>Scan for 1</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_scan1</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,12 +16,49 @@ <para> Scans <parameter>a</parameter>, starting with bit <parameter>start</parameter>, towards more significant bits, - until the first set bit is found. Returns the index of the found - bit. If no set bit is found, -1 is returned. + until the first set bit is found. </para> - <example> - <title><function>gmp_scan1</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number to scan. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>start</parameter></term> + <listitem> + <para> + The starting bit. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the index of the found bit, as an <type>integer</type>. + If no set bit is found, -1 is returned. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_scan1</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // "1" bit is found at position 3. index starts at 0 @@ -33,18 +70,18 @@ echo gmp_scan1($s2, 5) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 9 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-setbit.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-setbit.xml diff -u phpdoc/en/reference/gmp/functions/gmp-setbit.xml:1.9 phpdoc/en/reference/gmp/functions/gmp-setbit.xml:1.10 --- phpdoc/en/reference/gmp/functions/gmp-setbit.xml:1.9 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-setbit.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.10 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-setbit"> <refnamediv> <refname>gmp_setbit</refname> <refpurpose>Set bit</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>void</type><methodname>gmp_setbit</methodname> <methodparam><type>resource</type><parameter role="reference">a</parameter></methodparam> @@ -15,22 +15,57 @@ <methodparam choice="opt"><type>bool</type><parameter>set_clear</parameter></methodparam> </methodsynopsis> <para> - Sets bit <parameter>index</parameter> in - <parameter>a</parameter>. <parameter>set_clear</parameter> - defines if the bit is set to 0 or 1. By default the bit is set to - 1. Index starts at 0. + Sets bit <parameter>index</parameter> in <parameter>a</parameter>. </para> - <note> - <para> - Unlike most of the other GMP functions, <function>gmp_setbit</function> - must be called with a GMP resource that already exists (using - <function>gmp_init</function> for example). One will not be - automatically created. - </para> - </note> - <example> - <title><function>gmp_setbit</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being set to. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>index</parameter></term> + <listitem> + <para> + The set bit. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>set_clear</parameter></term> + <listitem> + <para> + Defines if the bit is set to 0 or 1. By default the bit is set to + 1. Index starts at 0. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_setbit</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $a = gmp_init("0xfd"); @@ -38,21 +73,39 @@ echo gmp_strval($a) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 255 ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + Unlike most of the other GMP functions, <function>gmp_setbit</function> + must be called with a GMP resource that already exists (using + <function>gmp_init</function> for example). One will not be + automatically created. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_clrbit</function> and - <function>gmp_testbit</function>. + <simplelist> + <member><function>gmp_clrbit</function></member> + <member><function>gmp_testbit</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-sign.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-sign.xml diff -u phpdoc/en/reference/gmp/functions/gmp-sign.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-sign.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-sign.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-sign.xml Sat Jul 21 04:19:32 2007 @@ -1,25 +1,51 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-sign"> <refnamediv> <refname>gmp_sign</refname> <refpurpose>Sign of number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_sign</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> + Checks the sign of a number. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> Returns 1 if <parameter>a</parameter> is positive, -1 if <parameter>a</parameter> is negative, and 0 if <parameter>a</parameter> is zero. </para> - <example> - <title><function>gmp_sign</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_sign</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // positive @@ -32,19 +58,19 @@ echo gmp_sign("0") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1 -1 0 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-sqrt.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-sqrt.xml diff -u phpdoc/en/reference/gmp/functions/gmp-sqrt.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-sqrt.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-sqrt.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-sqrt.xml Sat Jul 21 04:19:32 2007 @@ -1,24 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-sqrt"> <refnamediv> <refname>gmp_sqrt</refname> <refpurpose>Calculate square root</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_sqrt</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - Calculates square root of <parameter>a</parameter> and returns the - integer portion of the result. + Calculates square root of <parameter>a</parameter>. </para> - <example> - <title><function>gmp_sqrt</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The integer portion of the square root, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_sqrt</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $sqrt1 = gmp_sqrt("9"); @@ -30,19 +55,19 @@ echo gmp_strval($sqrt3) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 2 1234567890 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml diff -u phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml:1.8 phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml:1.9 --- phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml:1.8 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml Sat Jul 21 04:19:32 2007 @@ -1,26 +1,55 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-sqrtrem"> <refnamediv> <refname>gmp_sqrtrem</refname> <refpurpose>Square root with remainder</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>gmp_sqrtrem</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> + Calculate the square root of a number, with remainder. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being square rooted. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> Returns array where first element is the integer square root of - <parameter>a</parameter> (see also - <function>gmp_sqrt</function>), and the second is the remainder + <parameter>a</parameter> and the second is the remainder (i.e., the difference between <parameter>a</parameter> and the first element squared). </para> - <example> - <title><function>gmp_sqrtrem</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_sqrtrem</function> example</title> + <programlisting role="php"> <![CDATA[ <?php list($sqrt1, $sqrt1rem) = gmp_sqrtrem("9"); @@ -32,19 +61,19 @@ echo gmp_strval($sqrt3) . ", " . gmp_strval($sqrt3rem) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3, 0 2, 3 1024, 0 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-strval.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-strval.xml diff -u phpdoc/en/reference/gmp/functions/gmp-strval.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-strval.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-strval.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-strval.xml Sat Jul 21 04:19:32 2007 @@ -1,23 +1,59 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-strval"> <refnamediv> <refname>gmp_strval</refname> <refpurpose>Convert GMP number to string</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>gmp_strval</methodname> - <methodparam><type>resource</type><parameter>gmpnumber</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> + <methodparam><type>resource</type><parameter>gmpnumber</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> </methodsynopsis> <para> Convert GMP number to string representation in base - <parameter>base</parameter>. The default base is 10. Allowed - values for the base are from 2 to 36. + <parameter>base</parameter>. The default base is 10. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>gmpnumber</parameter></term> + <listitem> + <para> + The GMP number that will be converted to a string. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + The base of the returned number. The default base is 10. + Allowed values for the base are from 2 to 36. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The number, as a <type>string</type>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title>Converting a GMP number to a string</title> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-sub.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-sub.xml diff -u phpdoc/en/reference/gmp/functions/gmp-sub.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-sub.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-sub.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-sub.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-sub"> <refnamediv> <refname>gmp_sub</refname> <refpurpose>Subtract numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_sub</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -17,26 +17,65 @@ Subtracts <parameter>b</parameter> from <parameter>a</parameter> and returns the result. </para> - <example> - <title><function>gmp_sub</function> example</title> - <programlisting role="php"> + </refsect1> + + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being subtracted from. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + <para> + The number subtracted from <parameter>a</parameter>. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_sub</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $sub = gmp_sub("281474976710656", "4294967296"); // 2^48 - 2^32 echo gmp_strval($sub) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 281470681743360 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-testbit.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-testbit.xml diff -u phpdoc/en/reference/gmp/functions/gmp-testbit.xml:1.3 phpdoc/en/reference/gmp/functions/gmp-testbit.xml:1.4 --- phpdoc/en/reference/gmp/functions/gmp-testbit.xml:1.3 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-testbit.xml Sat Jul 21 04:19:32 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-testbit"> <refnamediv> <refname>gmp_testbit</refname> @@ -25,9 +25,7 @@ <varlistentry> <term><parameter>a</parameter></term> <listitem> - <para> - A GMP number resource - </para> + &gmp.parameter; </listitem> </varlistentry> <varlistentry> @@ -52,7 +50,8 @@ <refsect1 role="errors"> &reftitle.errors; <para> - E_WARNING is issued when <parameter>index</parameter> is less than zero. + <constant>E_WARNING</constant> is issued when + <parameter>index</parameter> is less than zero. </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-xor.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-xor.xml diff -u phpdoc/en/reference/gmp/functions/gmp-xor.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-xor.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-xor.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-xor.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-xor"> <refnamediv> <refname>gmp_xor</refname> <refpurpose>Logical XOR</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_xor</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,9 +16,41 @@ <para> Calculates logical exclusive OR (XOR) of two GMP numbers. </para> - <example> - <title><function>gmp_xor</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_xor</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $xor1 = gmp_init("1101101110011101", 2); @@ -29,17 +61,17 @@ echo gmp_strval($xor3, 2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1011110111000100 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/language-snippets.ent?r1=1.206&r2=1.207&diff_format=u Index: phpdoc/en/language-snippets.ent diff -u phpdoc/en/language-snippets.ent:1.206 phpdoc/en/language-snippets.ent:1.207 --- phpdoc/en/language-snippets.ent:1.206 Sun Jul 1 01:52:48 2007 +++ phpdoc/en/language-snippets.ent Sat Jul 21 04:19:32 2007 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.206 $ --> +<!-- $Revision: 1.207 $ --> <!-- Keep 'em sorted --> @@ -526,6 +526,11 @@ returned by <function>fbsql_query</function> or <function>fbsql_db_query</function>.</para></listitem></varlistentry>'> +<!-- GMP Notes --> +<!ENTITY gmp.return 'A GMP number <type>resource</type>.'> +<!ENTITY gmp.parameter '<para>It can be either a GMP number <type>resource</type>, or a +numeric string given that it is possible to convert the latter to a number.</para>'> + <!-- MySQLi Notes --> <!ENTITY mysqli.result.description '<varlistentry><term><parameter> result</parameter></term><listitem><para>Procedural style only: A result set
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-abs.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-abs.xml diff -u phpdoc/en/reference/gmp/functions/gmp-abs.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-abs.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-abs.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-abs.xml Sat Jul 21 04:19:31 2007 @@ -1,23 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-abs"> <refnamediv> <refname>gmp_abs</refname> <refpurpose>Absolute value</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_abs</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - Returns absolute value of <parameter>a</parameter>. + Get the absolute value of a number. </para> - <example> - <title><function>gmp_abs</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the absolute value of <parameter>a</parameter>, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_abs</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $abs1 = gmp_abs("274982683358"); @@ -27,17 +53,16 @@ echo gmp_strval($abs2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 274982683358 274982683358 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> </refentry> @@ -60,4 +85,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> +--> \ No newline at end of file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-add.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-add.xml diff -u phpdoc/en/reference/gmp/functions/gmp-add.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-add.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-add.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-add.xml Sat Jul 21 04:19:31 2007 @@ -1,42 +1,79 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-add"> <refnamediv> <refname>gmp_add</refname> <refpurpose>Add numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_add</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> - Add two GMP numbers. The result will be a GMP number representing - the sum of the arguments. + Add two numbers. </para> - <example> - <title><function>gmp_add</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + A number that will be added. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + <para> + A number that will be added. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A GMP number representing the sum of the arguments. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_add</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $sum = gmp_add("123456789012345", "76543210987655"); echo gmp_strval($sum) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 200000000000000 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-and.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-and.xml diff -u phpdoc/en/reference/gmp/functions/gmp-and.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-and.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-and.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-and.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-and"> <refnamediv> <refname>gmp_and</refname> <refpurpose>Logical AND</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_and</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,6 +16,37 @@ <para> Calculates logical AND of two GMP numbers. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A GMP number representing the logical <literal>AND</literal> comparison. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <example> <title><function>gmp_and</function> example</title> <programlisting role="php"> @@ -28,9 +59,7 @@ ?> ]]> </programlisting> - <para> - The printout of the above program will be: - </para> + &example.outputs; <screen> <![CDATA[ 4 @@ -39,6 +68,7 @@ </screen> </example> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-clrbit.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-clrbit.xml diff -u phpdoc/en/reference/gmp/functions/gmp-clrbit.xml:1.10 phpdoc/en/reference/gmp/functions/gmp-clrbit.xml:1.11 --- phpdoc/en/reference/gmp/functions/gmp-clrbit.xml:1.10 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-clrbit.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.11 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-clrbit"> <refnamediv> <refname>gmp_clrbit</refname> <refpurpose>Clear bit</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>void</type><methodname>gmp_clrbit</methodname> <methodparam><type>resource</type><parameter role="reference">a</parameter></methodparam> @@ -17,14 +17,37 @@ Clears (sets to 0) bit <parameter>index</parameter> in <parameter>a</parameter>. The index starts at 0. </para> - <note> - <para> - Unlike most of the other GMP functions, <function>gmp_clrbit</function> - must be called with a GMP resource that already exists (using - <function>gmp_init</function> for example). One will not be - automatically created. - </para> - </note> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>index</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <example> <title><function>gmp_clrbit</function> example</title> <programlisting role="php"> @@ -36,20 +59,37 @@ ?> ]]> </programlisting> - <para> - The printout of the above program will be: - </para> + &example.outputs; <screen> <![CDATA[ 254 ]]> </screen> </example> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + Unlike most of the other GMP functions, <function>gmp_clrbit</function> + must be called with a GMP resource that already exists (using + <function>gmp_init</function> for example). One will not be + automatically created. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_setbit</function> and - <function>gmp_testbit</function>. + <simplelist> + <member><function>gmp_setbit</function></member> + <member><function>gmp_testbit</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-cmp.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-cmp.xml diff -u phpdoc/en/reference/gmp/functions/gmp-cmp.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-cmp.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-cmp.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-cmp.xml Sat Jul 21 04:19:31 2007 @@ -1,23 +1,54 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-cmp"> <refnamediv> <refname>gmp_cmp</refname> <refpurpose>Compare numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_cmp</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> + Compares two numbers. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> Returns a positive value if <literal>a > b</literal>, zero if <literal>a = b</literal> and a negative value if <literal>a < b</literal>. </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <example> <title><function>gmp_cmp</function> example</title> <programlisting role="php"> @@ -31,9 +62,7 @@ ?> ]]> </programlisting> - <para> - The printout of the above program will be: - </para> + &example.outputs; <screen> <![CDATA[ 1 -1 0 @@ -41,6 +70,7 @@ </screen> </example> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-com.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-com.xml diff -u phpdoc/en/reference/gmp/functions/gmp-com.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-com.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-com.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-com.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.20 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id='function.gmp-com'> <refnamediv> <refname>gmp_com</refname> <refpurpose>Calculates one's complement</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_com</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -15,6 +15,31 @@ <para> Returns the one's complement of <parameter>a</parameter>. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the one's complement of <parameter>a</parameter>, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <example> <title><function>gmp_com</function> example</title> <programlisting role="php"> @@ -25,17 +50,15 @@ ?> ]]> </programlisting> - <para> - The printout of the above program will be: - </para> + &example.outputs; <screen> <![CDATA[ -1235 ]]> </screen> </example> - </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-div-q.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-div-q.xml diff -u phpdoc/en/reference/gmp/functions/gmp-div-q.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-div-q.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-div-q.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-div-q.xml Sat Jul 21 04:19:31 2007 @@ -1,51 +1,95 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-div-q"> <refnamediv> <refname>gmp_div_q</refname> <refpurpose>Divide numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_div_q</methodname> - <methodparam><type>resource</type><parameter>a</parameter></methodparam> - <methodparam><type>resource</type><parameter>b</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>round</parameter></methodparam> + <methodparam><type>resource</type><parameter>a</parameter></methodparam> + <methodparam><type>resource</type><parameter>b</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>round</parameter></methodparam> </methodsynopsis> <para> Divides <parameter>a</parameter> by <parameter>b</parameter> and - returns the integer result. The result rounding is defined by the - <parameter>round</parameter>, which can have the following - values: - <itemizedlist> - <listitem> - <simpara> - <parameter>GMP_ROUND_ZERO</parameter>: The result is truncated - towards 0. - </simpara> - </listitem> - <listitem> - <simpara> - <parameter>GMP_ROUND_PLUSINF</parameter>: The result is - rounded towards <literal>+infinity</literal>. - </simpara> - </listitem> - <listitem> - <simpara> - <parameter>GMP_ROUND_MINUSINF</parameter>: The result is - rounded towards <literal>-infinity</literal>. - </simpara> - </listitem> - </itemizedlist> + returns the integer result. </para> - <simpara> - This function can also be called as <function>gmp_div</function>. - </simpara> - <example> - <title><function>gmp_div_q</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being divided. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + <para> + The number that <parameter>a</parameter> is being divided by. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>round</parameter></term> + <listitem> + <para> + The result rounding is defined by the + <parameter>round</parameter>, which can have the following + values: + <itemizedlist> + <listitem> + <simpara> + <constant>GMP_ROUND_ZERO</constant>: The result is truncated + towards 0. + </simpara> + </listitem> + <listitem> + <simpara> + <constant>GMP_ROUND_PLUSINF</constant>: The result is + rounded towards <literal>+infinity</literal>. + </simpara> + </listitem> + <listitem> + <simpara> + <constant>GMP_ROUND_MINUSINF</constant>: The result is + rounded towards <literal>-infinity</literal>. + </simpara> + </listitem> + </itemizedlist> + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_div_q</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $div1 = gmp_div_q("100", "5"); @@ -64,11 +108,9 @@ echo gmp_strval($div5) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 20 0 @@ -76,13 +118,30 @@ 0 -1 ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + This function can also be called as <function>gmp_div</function>. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_div_r</function>, - <function>gmp_div_qr</function> + <simplelist> + <member><function>gmp_div_r</function></member> + <member><function>gmp_div_qr</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-div-qr.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-div-qr.xml diff -u phpdoc/en/reference/gmp/functions/gmp-div-qr.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-div-qr.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-div-qr.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-div-qr.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-div-qr"> <refnamediv> <refname>gmp_div_qr</refname> <refpurpose>Divide numbers and get quotient and remainder</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>gmp_div_qr</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> @@ -15,16 +15,57 @@ <methodparam choice="opt"><type>int</type><parameter>round</parameter></methodparam> </methodsynopsis> <para> - The function divides <parameter>n</parameter> by - <parameter>d</parameter> and returns array, with the first + The function divides <parameter>n</parameter> by <parameter>d</parameter>. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>n</parameter></term> + <listitem> + <para> + The number being divided. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>d</parameter></term> + <listitem> + <para> + The number that <parameter>n</parameter> is being divided by. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>round</parameter></term> + <listitem> + <para> + See the <function>gmp_div_q</function> function for description + of the <parameter>round</parameter> argument. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns an <type>array</type>, with the first element being <literal>[n/d]</literal> (the integer result of the division) and the second being <literal>(n - [n/d] * d)</literal> (the remainder of the division). </para> - <para> - See the <function>gmp_div_q</function> function for description - of the <parameter>round</parameter> argument. - </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title>Division of GMP numbers</title> @@ -40,9 +81,15 @@ </programlisting> </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_div_q</function>, - <function>gmp_div_r</function>. + <simplelist> + <member><function>gmp_div_q</function></member> + <member><function>gmp_div_r</function></member> + </simplelist> </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-div-r.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-div-r.xml diff -u phpdoc/en/reference/gmp/functions/gmp-div-r.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-div-r.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-div-r.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-div-r.xml Sat Jul 21 04:19:31 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-div-r"> <refnamediv> <refname>gmp_div_r</refname> <refpurpose>Remainder of the division of numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_div_r</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> @@ -20,34 +20,83 @@ remainder has the sign of the <parameter>n</parameter> argument, if not zero. </para> - <example> - <title><function>gmp_div_r</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>n</parameter></term> + <listitem> + <para> + The number being divided. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>d</parameter></term> + <listitem> + <para> + The number that <parameter>n</parameter> is being divided by. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>round</parameter></term> + <listitem> + <para> + See the <function>gmp_div_q</function> function for description + of the <parameter>round</parameter> argument. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The remainder, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_div_r</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $div = gmp_div_r("105", "20"); echo gmp_strval($div) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 5 ]]> - </screen> - </example> - <para> - See the <function>gmp_div_q</function> function for description - of the <parameter>round</parameter> argument. + </screen> + </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_div_q</function>, - <function>gmp_div_qr</function> + <simplelist> + <member><function>gmp_div_q</function></member> + <member><function>gmp_div_qr</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-div.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-div.xml diff -u phpdoc/en/reference/gmp/functions/gmp-div.xml:1.5 phpdoc/en/reference/gmp/functions/gmp-div.xml:1.6 --- phpdoc/en/reference/gmp/functions/gmp-div.xml:1.5 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-div.xml Sat Jul 21 04:19:31 2007 @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.6 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-div"> <refnamediv> <refname>gmp_div</refname> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-divexact.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-divexact.xml diff -u phpdoc/en/reference/gmp/functions/gmp-divexact.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-divexact.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-divexact.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-divexact.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-divexact"> <refnamediv> <refname>gmp_divexact</refname> <refpurpose>Exact division of numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_divexact</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> @@ -19,9 +19,47 @@ correct results only when it is known in advance that <parameter>d</parameter> divides <parameter>n</parameter>. </para> - <example> - <title><function>gmp_divexact</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>n</parameter></term> + <listitem> + <para> + The number being divided. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>d</parameter></term> + <listitem> + <para> + The number that <parameter>a</parameter> is being divided by. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_divexact</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $div1 = gmp_divexact("10", "2"); @@ -31,18 +69,18 @@ echo gmp_strval($div2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 5 2863311534 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-fact.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-fact.xml diff -u phpdoc/en/reference/gmp/functions/gmp-fact.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-fact.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-fact.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-fact.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-fact"> <refnamediv> <refname>gmp_fact</refname> <refpurpose>Factorial</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_fact</methodname> <methodparam><type>int</type><parameter>a</parameter></methodparam> @@ -15,9 +15,38 @@ <para> Calculates factorial (<literal>a!</literal>) of <parameter>a</parameter>. </para> - <example> - <title><function>gmp_fact</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The factorial number. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_fact</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $fact1 = gmp_fact(5); // 5 * 4 * 3 * 2 * 1 @@ -27,18 +56,18 @@ echo gmp_strval($fact2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 120 30414093201713378043612608166064768844377641568960512000000000000 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-gcd.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-gcd.xml diff -u phpdoc/en/reference/gmp/functions/gmp-gcd.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-gcd.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-gcd.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-gcd.xml Sat Jul 21 04:19:32 2007 @@ -1,43 +1,76 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-gcd"> <refnamediv> <refname>gmp_gcd</refname> <refpurpose>Calculate GCD</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_gcd</methodname> - <methodparam><type>resource</type><parameter>a</parameter></methodparam> - <methodparam><type>resource</type><parameter>b</parameter></methodparam> + <methodparam><type>resource</type><parameter>a</parameter></methodparam> + <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> Calculate greatest common divisor of <parameter>a</parameter> and <parameter>b</parameter>. The result is always positive even if either of, or both, input operands are negative. </para> - <example> - <title><function>gmp_gcd</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A positive GMP number that divides into both + <parameter>a</parameter> and <parameter>b</parameter>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_gcd</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $gcd = gmp_gcd("12", "21"); echo gmp_strval($gcd) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-gcdext.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-gcdext.xml diff -u phpdoc/en/reference/gmp/functions/gmp-gcdext.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-gcdext.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-gcdext.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-gcdext.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-gcdext"> <refnamediv> <refname>gmp_gcdext</refname> <refpurpose>Calculate GCD and multipliers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>gmp_gcdext</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -22,9 +22,40 @@ This function can be used to solve linear Diophantine equations in two variables. These are equations that allow only integer solutions and have the form: <literal>a*x + b*y = c</literal>. - For more information, go to the <link xlink:href="&url.diophantine-equation;">"Diophantine - Equation" page at MathWorld</link> + For more information, go to the <link xlink:href="&url.diophantine-equation;">"Diophantine + Equation" page at MathWorld</link> </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + An <type>array</type> of GMP numbers. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title>Solving a linear Diophantine equation</title> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-hamdist.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-hamdist.xml diff -u phpdoc/en/reference/gmp/functions/gmp-hamdist.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-hamdist.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-hamdist.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-hamdist.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-hamdist"> <refnamediv> <refname>gmp_hamdist</refname> <refpurpose>Hamming distance</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_hamdist</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -17,9 +17,47 @@ Returns the hamming distance between <parameter>a</parameter> and <parameter>b</parameter>. Both operands should be non-negative. </para> - <example> - <title><function>gmp_hamdist</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + <para> + It should be positive. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + <para> + It should be positive. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_hamdist</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $ham1 = gmp_init("1001010011", 2); @@ -30,22 +68,28 @@ echo gmp_popcount(gmp_xor($ham1, $ham2)) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 6 6 ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_popcount</function>, - <function>gmp_xor</function> + <simplelist> + <member><function>gmp_popcount</function></member> + <member><function>gmp_xor</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-init.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-init.xml diff -u phpdoc/en/reference/gmp/functions/gmp-init.xml:1.8 phpdoc/en/reference/gmp/functions/gmp-init.xml:1.9 --- phpdoc/en/reference/gmp/functions/gmp-init.xml:1.8 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-init.xml Sat Jul 21 04:19:32 2007 @@ -1,31 +1,88 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.9 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-init"> <refnamediv> <refname>gmp_init</refname> <refpurpose>Create GMP number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_init</methodname> <methodparam><type>mixed</type><parameter>number</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> </methodsynopsis> <para> - Creates a GMP number from an integer or string. String - representation can be decimal, hexadecimal or octal. - Optional parameter <parameter>base</parameter> is available since - PHP 4.1.0. Its default value is <literal>0</literal>. + Creates a GMP number from an integer or string. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; <para> - The base may vary from 2 to 36. If base is 0 (default value), the - actual base is determined from the leading characters: if the first - two characters are <literal>0x</literal> or <literal>0X</literal>, - hexadecimal is assumed, otherwise if the first character is "0", - octal is assumed, otherwise decimal is assumed. + <variablelist> + <varlistentry> + <term><parameter>number</parameter></term> + <listitem> + <para> + An integer or a string. The string representation can be decimal, + hexadecimal or octal. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + The base. Defaults to 0. + </para> + <para> + The base may vary from 2 to 36. If base is 0 (default value), the + actual base is determined from the leading characters: if the first + two characters are <literal>0x</literal> or <literal>0X</literal>, + hexadecimal is assumed, otherwise if the first character is "0", + octal is assumed, otherwise decimal is assumed. + </para> + </listitem> + </varlistentry> + </variablelist> </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>4.1.0</entry> + <entry> + The optional <parameter>base</parameter> parameter was added. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title>Creating GMP number</title> @@ -39,7 +96,10 @@ </programlisting> </example> </para> + </refsect1> + <refsect1 role="notes"> + &reftitle.notes; <note> <para> It is not necessary to call this function if you want to use @@ -51,6 +111,7 @@ </para> </note> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-intval.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-intval.xml diff -u phpdoc/en/reference/gmp/functions/gmp-intval.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-intval.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-intval.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-intval.xml Sat Jul 21 04:19:32 2007 @@ -1,30 +1,51 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-intval"> <refnamediv> <refname>gmp_intval</refname> <refpurpose>Convert GMP number to integer</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_intval</methodname> <methodparam><type>resource</type><parameter>gmpnumber</parameter></methodparam> </methodsynopsis> <para> This function allows to convert GMP number to integer. - <warning> - <simpara> - This function returns a useful result only if the number actually - fits the PHP integer (i.e., signed long type). If you want just - to print the GMP number, use <function>gmp_strval</function>. - </simpara> - </warning> </para> - <example> - <title><function>gmp_intval</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>gmpnumber</parameter></term> + <listitem> + <para> + A GMP number. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + An <type>integer</type> value of <parameter>gmpnumber</parameter>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_intval</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // displays correct result @@ -37,19 +58,30 @@ echo gmp_strval("2147483648") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 2147483647 2147483647 2147483648 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <warning> + <simpara> + This function returns a useful result only if the number actually + fits the PHP integer (i.e., signed long type). If you want just + to print the GMP number, use <function>gmp_strval</function>. + </simpara> + </warning> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-invert.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-invert.xml diff -u phpdoc/en/reference/gmp/functions/gmp-invert.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-invert.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-invert.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-invert.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-invert"> <refnamediv> <refname>gmp_invert</refname> <refpurpose>Inverse by modulo</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_invert</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -15,12 +15,43 @@ </methodsynopsis> <para> Computes the inverse of <parameter>a</parameter> modulo - <parameter>b</parameter>. Returns &false; if an inverse does not - exist. + <parameter>b</parameter>. </para> - <example> - <title><function>gmp_invert</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A GMP number on success or &false; if an inverse does not exist. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_invert</function> example</title> + <programlisting role="php"> <![CDATA[ <?php echo gmp_invert("5", "10"); // no inverse, outputs nothing, result is FALSE @@ -28,17 +59,17 @@ echo gmp_strval($invert) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 9 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-jacobi.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-jacobi.xml diff -u phpdoc/en/reference/gmp/functions/gmp-jacobi.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-jacobi.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-jacobi.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-jacobi.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-jacobi"> <refnamediv> <refname>gmp_jacobi</refname> <refpurpose>Jacobi symbol</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_jacobi</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -15,32 +15,66 @@ </methodsynopsis> <para> Computes - <link xlink:href="&url.jacobi;"> - Jacobi symbol</link> of <parameter>a</parameter> and + <link xlink:href="&url.jacobi;">Jacobi symbol</link> of <parameter>a</parameter> and <parameter>p</parameter>. <parameter>p</parameter> should be odd and must be positive. </para> - <example> - <title><function>gmp_jacobi</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>p</parameter></term> + <listitem> + &gmp.parameter; + <para> + Should be odd and must be positive. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_jacobi</function> example</title> + <programlisting role="php"> <![CDATA[ <?php echo gmp_jacobi("1", "3") . "\n"; echo gmp_jacobi("2", "3") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1 0 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-legendre.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-legendre.xml diff -u phpdoc/en/reference/gmp/functions/gmp-legendre.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-legendre.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-legendre.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-legendre.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-legendre"> <refnamediv> <refname>gmp_legendre</refname> <refpurpose>Legendre symbol</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_legendre</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -20,27 +20,62 @@ <parameter>p</parameter>. <parameter>p</parameter> should be odd and must be positive. </para> - <example> - <title><function>gmp_legendre</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>p</parameter></term> + <listitem> + &gmp.parameter; + <para> + Should be odd and must be positive. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_legendre</function> example</title> + <programlisting role="php"> <![CDATA[ <?php echo gmp_legendre("1", "3") . "\n"; echo gmp_legendre("2", "3") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1 0 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-mod.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-mod.xml diff -u phpdoc/en/reference/gmp/functions/gmp-mod.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-mod.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-mod.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-mod.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-mod"> <refnamediv> <refname>gmp_mod</refname> <refpurpose>Modulo operation</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_mod</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> @@ -18,26 +18,61 @@ <parameter>d</parameter>. The result is always non-negative, the sign of <parameter>d</parameter> is ignored. </para> - <example> - <title><function>gmp_mod</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>n</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>d</parameter></term> + <listitem> + <para> + The modulo that is being evaluated. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_mod</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $mod = gmp_mod("8", "3"); echo gmp_strval($mod) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 2 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-mul.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-mul.xml diff -u phpdoc/en/reference/gmp/functions/gmp-mul.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-mul.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-mul.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-mul.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-mul"> <refnamediv> <refname>gmp_mul</refname> <refpurpose>Multiply numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_mul</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -17,26 +17,64 @@ Multiplies <parameter>a</parameter> by <parameter>b</parameter> and returns the result. </para> - <example> - <title><function>gmp_mul</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + A number that will be multiplied by <parameter>b</parameter>. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + <para> + A number that will be multiplied by <parameter>a</parameter>. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_mul</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $mul = gmp_mul("12345678", "2000"); echo gmp_strval($mul) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 24691356000 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-neg.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-neg.xml diff -u phpdoc/en/reference/gmp/functions/gmp-neg.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-neg.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-neg.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-neg.xml Sat Jul 21 04:19:32 2007 @@ -1,23 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-neg"> <refnamediv> <refname>gmp_neg</refname> <refpurpose>Negate number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_neg</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - Returns -<parameter>a</parameter>. + Returns the negative value of a number. </para> - <example> - <title><function>gmp_neg</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns -<parameter>a</parameter>, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_neg</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $neg1 = gmp_neg("1"); @@ -26,18 +52,18 @@ echo gmp_strval($neg2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ -1 1 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-nextprime.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-nextprime.xml diff -u phpdoc/en/reference/gmp/functions/gmp-nextprime.xml:1.3 phpdoc/en/reference/gmp/functions/gmp-nextprime.xml:1.4 --- phpdoc/en/reference/gmp/functions/gmp-nextprime.xml:1.3 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-nextprime.xml Sat Jul 21 04:19:32 2007 @@ -1,26 +1,50 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-nextprime"> <refnamediv> <refname>gmp_nextprime</refname> <refpurpose>Find next prime number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <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>. + Find next prime number </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; <para> - This function uses a probabilistic algorithm to identify primes and - chances to get a composite number are extremely small. + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> </para> - <example> - <title><function>gmp_nextprime</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Return the next prime number greater than <parameter>a</parameter>, + as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_nextprime</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $prime1 = gmp_nextprime(10); // next prime number greater than 10 @@ -30,18 +54,28 @@ echo gmp_strval($prime2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program is: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 11 -997 ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + This function uses a probabilistic algorithm to identify primes and + chances to get a composite number are extremely small. + </para> + </note> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-or.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-or.xml diff -u phpdoc/en/reference/gmp/functions/gmp-or.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-or.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-or.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-or.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-or"> <refnamediv> <refname>gmp_or</refname> <refpurpose>Logical OR</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_or</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,9 +16,41 @@ <para> Calculates logical inclusive OR of two GMP numbers. </para> - <example> - <title><function>gmp_or</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_or</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $or1 = gmp_or("0xfffffff2", "4"); @@ -27,18 +59,18 @@ echo gmp_strval($or2, 16) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ fffffff6 fffffff2 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml diff -u phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-perfect-square.xml Sat Jul 21 04:19:32 2007 @@ -1,24 +1,53 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-perfect-square"> <refnamediv> <refname>gmp_perfect_square</refname> <refpurpose>Perfect square check</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>bool</type><methodname>gmp_perfect_square</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> + Check if a number is a perfect square. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being checked as a perfect square. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> Returns &true; if <parameter>a</parameter> is a perfect square, &false; otherwise. </para> - <example> - <title><function>gmp_perfect_square</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_perfect_square</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // 3 * 3, perfect square @@ -31,23 +60,29 @@ var_dump(gmp_perfect_square("1524157875019052100")); ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ bool(true) bool(false) bool(true) ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also: <function>gmp_sqrt</function>, - <function>gmp_sqrtrem</function>. + <simplelist> + <member><function>gmp_sqrt</function></member> + <member><function>gmp_sqrtrem</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-popcount.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-popcount.xml diff -u phpdoc/en/reference/gmp/functions/gmp-popcount.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-popcount.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-popcount.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-popcount.xml Sat Jul 21 04:19:32 2007 @@ -1,23 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-popcount"> <refnamediv> <refname>gmp_popcount</refname> <refpurpose>Population count</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_popcount</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - Return the population count of <parameter>a</parameter>. + Get the population count. </para> - <example> - <title><function>gmp_popcount</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The population count of <parameter>a</parameter>, as an <type>integer</type>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_popcount</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $pop1 = gmp_init("10000101", 2); // 3 1's @@ -26,18 +52,18 @@ echo gmp_popcount($pop2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 7 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-pow.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-pow.xml diff -u phpdoc/en/reference/gmp/functions/gmp-pow.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-pow.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-pow.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-pow.xml Sat Jul 21 04:19:32 2007 @@ -1,26 +1,62 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-pow"> <refnamediv> <refname>gmp_pow</refname> <refpurpose>Raise number into power</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_pow</methodname> <methodparam><type>resource</type><parameter>base</parameter></methodparam> <methodparam><type>int</type><parameter>exp</parameter></methodparam> </methodsynopsis> <para> - Raise <parameter>base</parameter> into power - <parameter>exp</parameter>. The case of 0^0 yields - 1. <parameter>exp</parameter> cannot be negative. + Raise <parameter>base</parameter> into power <parameter>exp</parameter>. </para> - <example> - <title><function>gmp_pow</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + The base number. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>exp</parameter></term> + <listitem> + <para> + The positive power to raise the <parameter>base</parameter>. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The new (raised) number, as a GMP number. The case of + <literal>0^0</literal> yields 1. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_pow</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $pow1 = gmp_pow("2", 31); @@ -31,18 +67,18 @@ echo gmp_strval($pow3) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 2147483648 1 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-powm.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-powm.xml diff -u phpdoc/en/reference/gmp/functions/gmp-powm.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-powm.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-powm.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-powm.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-powm"> <refnamediv> <refname>gmp_powm</refname> <refpurpose>Raise number into power with modulo</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_powm</methodname> <methodparam><type>resource</type><parameter>base</parameter></methodparam> @@ -19,26 +19,74 @@ <parameter>exp</parameter>) modulo <parameter>mod</parameter>. If <parameter>exp</parameter> is negative, result is undefined. </para> - <example> - <title><function>gmp_powm</function> example</title> - <programlisting role="php"> + </refsect1> + + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + The base number. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>exp</parameter></term> + <listitem> + <para> + The positive power to raise the <parameter>base</parameter>. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>mod</parameter></term> + <listitem> + <para> + The modulo. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The new (raised) number, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_powm</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $pow1 = gmp_powm("2", "31", "2147483649"); echo gmp_strval($pow1) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 2147483648 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml diff -u phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-prob-prime.xml Sat Jul 21 04:19:32 2007 @@ -1,33 +1,68 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-prob-prime"> <refnamediv> <refname>gmp_prob_prime</refname> <refpurpose>Check if number is "probably prime"</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_prob_prime</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>reps</parameter></methodparam> </methodsynopsis> <para> + The function uses Miller-Rabin's probabilistic test to check if a number is a prime. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being checked as a prime. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>reps</parameter></term> + <listitem> + <para> + Reasonable values + of <parameter>reps</parameter> vary from 5 to 10 (default being + 10); a higher value lowers the probability for a non-prime to + pass as a "probable" prime. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> If this function returns 0, <parameter>a</parameter> is definitely not prime. If it returns 1, then <parameter>a</parameter> is "probably" prime. If it returns 2, - then <parameter>a</parameter> is surely prime. Reasonable values - of <parameter>reps</parameter> vary from 5 to 10 (default being - 10); a higher value lowers the probability for a non-prime to - pass as a "probable" prime. + then <parameter>a</parameter> is surely prime. </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> - The function uses Miller-Rabin's probabilistic test. - </para> - <example> - <title><function>gmp_prob_prime</function> example</title> - <programlisting role="php"> + <example> + <title><function>gmp_prob_prime</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // definitely not a prime @@ -40,19 +75,19 @@ echo gmp_prob_prime("11") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 0 1 2 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-random.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-random.xml diff -u phpdoc/en/reference/gmp/functions/gmp-random.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-random.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-random.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-random.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-random"> <refnamediv> <refname>gmp_random</refname> <refpurpose>Random number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_random</methodname> <methodparam><type>int</type><parameter>limiter</parameter></methodparam> @@ -23,9 +23,38 @@ not static, and can vary from system to system. Generally, the number of bits in a limb is either 16 or 32, but this is not guaranteed. </para> - <example> - <title><function>gmp_random</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>limiter</parameter></term> + <listitem> + <para> + The limiter. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + A random GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_random</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $rand1 = gmp_random(1); // random number from 0 to 1 * bits per limb @@ -35,18 +64,18 @@ echo gmp_strval($rand2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program might be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1915834968 8642564075890328087 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-scan0.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-scan0.xml diff -u phpdoc/en/reference/gmp/functions/gmp-scan0.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-scan0.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-scan0.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-scan0.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-scan0"> <refnamediv> <refname>gmp_scan0</refname> <refpurpose>Scan for 0</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_scan0</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,12 +16,49 @@ <para> Scans <parameter>a</parameter>, starting with bit <parameter>start</parameter>, towards more significant bits, - until the first clear bit is found. Returns the index of the - found bit. The index starts from 0. + until the first clear bit is found. </para> - <example> - <title><function>gmp_scan0</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number to scan. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>start</parameter></term> + <listitem> + <para> + The starting bit. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the index of the found bit, as an <type>integer</type>. The + index starts from 0. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_scan0</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // "0" bit is found at position 3. index starts at 0 @@ -33,18 +70,18 @@ echo gmp_scan0($s2, 5) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 7 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-scan1.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-scan1.xml diff -u phpdoc/en/reference/gmp/functions/gmp-scan1.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-scan1.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-scan1.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-scan1.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-scan1"> <refnamediv> <refname>gmp_scan1</refname> <refpurpose>Scan for 1</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_scan1</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,12 +16,49 @@ <para> Scans <parameter>a</parameter>, starting with bit <parameter>start</parameter>, towards more significant bits, - until the first set bit is found. Returns the index of the found - bit. If no set bit is found, -1 is returned. + until the first set bit is found. </para> - <example> - <title><function>gmp_scan1</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number to scan. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>start</parameter></term> + <listitem> + <para> + The starting bit. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the index of the found bit, as an <type>integer</type>. + If no set bit is found, -1 is returned. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_scan1</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // "1" bit is found at position 3. index starts at 0 @@ -33,18 +70,18 @@ echo gmp_scan1($s2, 5) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 9 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-setbit.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-setbit.xml diff -u phpdoc/en/reference/gmp/functions/gmp-setbit.xml:1.9 phpdoc/en/reference/gmp/functions/gmp-setbit.xml:1.10 --- phpdoc/en/reference/gmp/functions/gmp-setbit.xml:1.9 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-setbit.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.10 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-setbit"> <refnamediv> <refname>gmp_setbit</refname> <refpurpose>Set bit</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>void</type><methodname>gmp_setbit</methodname> <methodparam><type>resource</type><parameter role="reference">a</parameter></methodparam> @@ -15,22 +15,57 @@ <methodparam choice="opt"><type>bool</type><parameter>set_clear</parameter></methodparam> </methodsynopsis> <para> - Sets bit <parameter>index</parameter> in - <parameter>a</parameter>. <parameter>set_clear</parameter> - defines if the bit is set to 0 or 1. By default the bit is set to - 1. Index starts at 0. + Sets bit <parameter>index</parameter> in <parameter>a</parameter>. </para> - <note> - <para> - Unlike most of the other GMP functions, <function>gmp_setbit</function> - must be called with a GMP resource that already exists (using - <function>gmp_init</function> for example). One will not be - automatically created. - </para> - </note> - <example> - <title><function>gmp_setbit</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being set to. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>index</parameter></term> + <listitem> + <para> + The set bit. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>set_clear</parameter></term> + <listitem> + <para> + Defines if the bit is set to 0 or 1. By default the bit is set to + 1. Index starts at 0. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_setbit</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $a = gmp_init("0xfd"); @@ -38,21 +73,39 @@ echo gmp_strval($a) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 255 ]]> - </screen> - </example> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + Unlike most of the other GMP functions, <function>gmp_setbit</function> + must be called with a GMP resource that already exists (using + <function>gmp_init</function> for example). One will not be + automatically created. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also <function>gmp_clrbit</function> and - <function>gmp_testbit</function>. + <simplelist> + <member><function>gmp_clrbit</function></member> + <member><function>gmp_testbit</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-sign.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-sign.xml diff -u phpdoc/en/reference/gmp/functions/gmp-sign.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-sign.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-sign.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-sign.xml Sat Jul 21 04:19:32 2007 @@ -1,25 +1,51 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-sign"> <refnamediv> <refname>gmp_sign</refname> <refpurpose>Sign of number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>gmp_sign</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> + Checks the sign of a number. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> Returns 1 if <parameter>a</parameter> is positive, -1 if <parameter>a</parameter> is negative, and 0 if <parameter>a</parameter> is zero. </para> - <example> - <title><function>gmp_sign</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_sign</function> example</title> + <programlisting role="php"> <![CDATA[ <?php // positive @@ -32,19 +58,19 @@ echo gmp_sign("0") . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1 -1 0 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-sqrt.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-sqrt.xml diff -u phpdoc/en/reference/gmp/functions/gmp-sqrt.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-sqrt.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-sqrt.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-sqrt.xml Sat Jul 21 04:19:32 2007 @@ -1,24 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-sqrt"> <refnamediv> <refname>gmp_sqrt</refname> <refpurpose>Calculate square root</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_sqrt</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - Calculates square root of <parameter>a</parameter> and returns the - integer portion of the result. + Calculates square root of <parameter>a</parameter>. </para> - <example> - <title><function>gmp_sqrt</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The integer portion of the square root, as a GMP number. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_sqrt</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $sqrt1 = gmp_sqrt("9"); @@ -30,19 +55,19 @@ echo gmp_strval($sqrt3) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3 2 1234567890 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml diff -u phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml:1.8 phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml:1.9 --- phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml:1.8 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-sqrtrem.xml Sat Jul 21 04:19:32 2007 @@ -1,26 +1,55 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-sqrtrem"> <refnamediv> <refname>gmp_sqrtrem</refname> <refpurpose>Square root with remainder</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>gmp_sqrtrem</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> + Calculate the square root of a number, with remainder. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being square rooted. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> Returns array where first element is the integer square root of - <parameter>a</parameter> (see also - <function>gmp_sqrt</function>), and the second is the remainder + <parameter>a</parameter> and the second is the remainder (i.e., the difference between <parameter>a</parameter> and the first element squared). </para> - <example> - <title><function>gmp_sqrtrem</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_sqrtrem</function> example</title> + <programlisting role="php"> <![CDATA[ <?php list($sqrt1, $sqrt1rem) = gmp_sqrtrem("9"); @@ -32,19 +61,19 @@ echo gmp_strval($sqrt3) . ", " . gmp_strval($sqrt3rem) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 3, 0 2, 3 1024, 0 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-strval.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-strval.xml diff -u phpdoc/en/reference/gmp/functions/gmp-strval.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-strval.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-strval.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-strval.xml Sat Jul 21 04:19:32 2007 @@ -1,23 +1,59 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-strval"> <refnamediv> <refname>gmp_strval</refname> <refpurpose>Convert GMP number to string</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>gmp_strval</methodname> - <methodparam><type>resource</type><parameter>gmpnumber</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> + <methodparam><type>resource</type><parameter>gmpnumber</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>base</parameter></methodparam> </methodsynopsis> <para> Convert GMP number to string representation in base - <parameter>base</parameter>. The default base is 10. Allowed - values for the base are from 2 to 36. + <parameter>base</parameter>. The default base is 10. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>gmpnumber</parameter></term> + <listitem> + <para> + The GMP number that will be converted to a string. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>base</parameter></term> + <listitem> + <para> + The base of the returned number. The default base is 10. + Allowed values for the base are from 2 to 36. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The number, as a <type>string</type>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title>Converting a GMP number to a string</title> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-sub.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-sub.xml diff -u phpdoc/en/reference/gmp/functions/gmp-sub.xml:1.6 phpdoc/en/reference/gmp/functions/gmp-sub.xml:1.7 --- phpdoc/en/reference/gmp/functions/gmp-sub.xml:1.6 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-sub.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.7 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-sub"> <refnamediv> <refname>gmp_sub</refname> <refpurpose>Subtract numbers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_sub</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -17,26 +17,65 @@ Subtracts <parameter>b</parameter> from <parameter>a</parameter> and returns the result. </para> - <example> - <title><function>gmp_sub</function> example</title> - <programlisting role="php"> + </refsect1> + + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + <para> + The number being subtracted from. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + <para> + The number subtracted from <parameter>a</parameter>. + </para> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_sub</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $sub = gmp_sub("281474976710656", "4294967296"); // 2^48 - 2^32 echo gmp_strval($sub) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 281470681743360 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-testbit.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-testbit.xml diff -u phpdoc/en/reference/gmp/functions/gmp-testbit.xml:1.3 phpdoc/en/reference/gmp/functions/gmp-testbit.xml:1.4 --- phpdoc/en/reference/gmp/functions/gmp-testbit.xml:1.3 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-testbit.xml Sat Jul 21 04:19:32 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-testbit"> <refnamediv> <refname>gmp_testbit</refname> @@ -25,9 +25,7 @@ <varlistentry> <term><parameter>a</parameter></term> <listitem> - <para> - A GMP number resource - </para> + &gmp.parameter; </listitem> </varlistentry> <varlistentry> @@ -52,7 +50,8 @@ <refsect1 role="errors"> &reftitle.errors; <para> - E_WARNING is issued when <parameter>index</parameter> is less than zero. + <constant>E_WARNING</constant> is issued when + <parameter>index</parameter> is less than zero. </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/gmp/functions/gmp-xor.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/gmp/functions/gmp-xor.xml diff -u phpdoc/en/reference/gmp/functions/gmp-xor.xml:1.7 phpdoc/en/reference/gmp/functions/gmp-xor.xml:1.8 --- phpdoc/en/reference/gmp/functions/gmp-xor.xml:1.7 Wed Jun 20 22:24:31 2007 +++ phpdoc/en/reference/gmp/functions/gmp-xor.xml Sat Jul 21 04:19:32 2007 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<!-- $Revision: 1.8 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-xor"> <refnamediv> <refname>gmp_xor</refname> <refpurpose>Logical XOR</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>gmp_xor</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> @@ -16,9 +16,41 @@ <para> Calculates logical exclusive OR (XOR) of two GMP numbers. </para> - <example> - <title><function>gmp_xor</function> example</title> - <programlisting role="php"> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>a</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>b</parameter></term> + <listitem> + &gmp.parameter; + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &gmp.return; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gmp_xor</function> example</title> + <programlisting role="php"> <![CDATA[ <?php $xor1 = gmp_init("1101101110011101", 2); @@ -29,17 +61,17 @@ echo gmp_strval($xor3, 2) . "\n"; ?> ]]> - </programlisting> - <para> - The printout of the above program will be: - </para> - <screen> + </programlisting> + &example.outputs; + <screen> <![CDATA[ 1011110111000100 ]]> - </screen> - </example> + </screen> + </example> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/language-snippets.ent?r1=1.206&r2=1.207&diff_format=u Index: phpdoc/en/language-snippets.ent diff -u phpdoc/en/language-snippets.ent:1.206 phpdoc/en/language-snippets.ent:1.207 --- phpdoc/en/language-snippets.ent:1.206 Sun Jul 1 01:52:48 2007 +++ phpdoc/en/language-snippets.ent Sat Jul 21 04:19:32 2007 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.206 $ --> +<!-- $Revision: 1.207 $ --> <!-- Keep 'em sorted --> @@ -526,6 +526,11 @@ returned by <function>fbsql_query</function> or <function>fbsql_db_query</function>.</para></listitem></varlistentry>'> +<!-- GMP Notes --> +<!ENTITY gmp.return 'A GMP number <type>resource</type>.'> +<!ENTITY gmp.parameter '<para>It can be either a GMP number <type>resource</type>, or a +numeric string given that it is possible to convert the latter to a number.</para>'> + <!-- MySQLi Notes --> <!ENTITY mysqli.result.description '<varlistentry><term><parameter> result</parameter></term><listitem><para>Procedural style only: A result set