cvs: phpdoc-fr /reference/gmp/functions 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-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-xor.xml

From: Date: Mon, 26 Apr 2004 14:06:57 +0000
Subject: cvs: phpdoc-fr /reference/gmp/functions 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-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-xor.xml
Groups: php.doc.fr 
Request: Send a blank email to doc-fr+get-2327@lists.php.net to get a copy of this message
didou Mon Apr 26 10:06:57 2004 EDT Modified files: /phpdoc-fr/reference/gmp/functions 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-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-xor.xml Log: sync with en

http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-com.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-com.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-com.xml:1.3 phpdoc-fr/reference/gmp/functions/gmp-com.xml:1.4 --- phpdoc-fr/reference/gmp/functions/gmp-com.xml:1.3 Wed Feb 25 07:36:28 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-com.xml Mon Apr 26 10:06:57 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.20 --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-com"> <refnamediv> <refname>gmp_com</refname> @@ -14,8 +13,25 @@ <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + Retourne le complémentaire de <parameter>a</parameter>. </para> + <example> + <title>Exemple avec <function>gmp_com</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$com = gmp_com("1234"); +echo gmp_strval($com) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +-1235 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-div-q.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-div-q.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-div-q.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-div-q.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-div-q.xml:1.6 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-div-q.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-div-q' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-div-q"> <refnamediv> <refname>gmp_div_q</refname> @@ -25,18 +22,18 @@ <itemizedlist> <listitem> <simpara> - <parameter>gmp_round_zero</parameter>: Le résultat est tronqué vers 0. + <parameter>GMP_ROUND_ZERO</parameter>: Le résultat est tronqué vers 0. </simpara> </listitem> <listitem> <simpara> - <parameter>gmp_round_plusinf</parameter>: Le résultat est tronqué vers + <parameter>GMP_ROUND_PLUSINF</parameter>: Le résultat est tronqué vers <literal>+infinity</literal> </simpara> </listitem> <listitem> <simpara> - <parameter>gmp_round_minusinf</parameter>: Le résultat est tronqué vers + <parameter>GMP_ROUND_MINUSINF</parameter>: Le résultat est tronqué vers <literal>-infinity</literal> </simpara> </listitem> @@ -46,6 +43,39 @@ <function>gmp_div_q</function> peut aussi être appelée <function>gmp_div</function>. </simpara> + <example> + <title>Exemple avec <function>gmp_div_q</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$div1 = gmp_div_q("100", "5"); +echo gmp_strval($div1) . "\n"; + +$div2 = gmp_div_q("1", "3"); +echo gmp_strval($div2) . "\n"; + +$div3 = gmp_div_q("1", "3", GMP_ROUND_PLUSINF); +echo gmp_strval($div3) . "\n"; + +$div4 = gmp_div_q("-1", "4", GMP_ROUND_PLUSINF); +echo gmp_strval($div4) . "\n"; + +$div5 = gmp_div_q("-1", "4", GMP_ROUND_MINUSINF); +echo gmp_strval($div5) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +20 +0 +1 +0 +1 +]]> + </screen> + </example> <para> Voir aussi <function>gmp_div_r</function> et http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-div-qr.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-div-qr.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-div-qr.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-div-qr.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-div-qr.xml:1.6 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-div-qr.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-div-qr' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-div-qr"> <refnamediv> <refname>gmp_div_qr</refname> @@ -33,10 +30,10 @@ <programlisting role="php"> <![CDATA[ <?php - $a = gmp_init ("0x41682179fbf5"); - $res = gmp_div_qr ($a, "0xDEFE75"); - printf("Le résultat est : q - %s, r - %s", - gmp_strval($res[0]), gmp_strval($res[1])); +$a = gmp_init("0x41682179fbf5"); +$res = gmp_div_qr($a, "0xDEFE75"); +printf("Le résultat est : q - %s, r - %s", + gmp_strval($res[0]), gmp_strval($res[1])); ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-div-r.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-div-r.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-div-r.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-div-r.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-div-r.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-div-r.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-div-r' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-div-r"> <refnamediv> <refname>gmp_div_r</refname> @@ -22,6 +19,23 @@ de <parameter>n</parameter> par <parameter>d</parameter>. Le reste a le même signe que <parameter>n</parameter>, s'il est non nul. </para> + <example> + <title>Exemple avec <function>gmp_div_r</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$div = gmp_div_r("105", "20"); +echo gmp_strval($div) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +5 +]]> + </screen> + </example> <para> Voir <function>gmp_div_q</function> pour une description du paramètre <parameter>round</parameter>. http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-div.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-div.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-div.xml:1.4 phpdoc-fr/reference/gmp/functions/gmp-div.xml:1.5 --- phpdoc-fr/reference/gmp/functions/gmp-div.xml:1.4 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-div.xml Mon Apr 26 10:06:57 2004 @@ -1,23 +1,15 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-div' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> <refentry id="function.gmp-div"> <refnamediv> <refname>gmp_div</refname> - <refpurpose>Divise deux nombres GMP</refpurpose> + <refpurpose>Alias de <function>gmp_div_q</function></refpurpose> </refnamediv> <refsect1> <title>Description</title> - <methodsynopsis> - <type>resource</type><methodname>gmp_div</methodname> - <methodparam><type>resource</type><parameter>a</parameter></methodparam> - <methodparam><type>resource</type><parameter>b</parameter></methodparam> - </methodsynopsis> <para> - <function>gmp_div</function> est un alias de <function>gmp_div_q</function>. + Cette fonction est un alias de <function>gmp_div_q</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-divexact.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-divexact.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-divexact.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-divexact.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-divexact.xml:1.6 Sun Feb 29 19:23:23 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-divexact.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-divexact' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-divexact"> <refnamediv> <refname>gmp_divexact</refname> @@ -23,6 +20,27 @@ s'il est su par avance que <parameter>d</parameter> divise <parameter>n</parameter>. </para> + <example> + <title>Exemple avec <function>gmp_divexact</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$div1 = gmp_divexact("10", "2"); +echo gmp_strval($div1) . "\n"; + +$div2 = gmp_divexact("10", "3"); // résultat incohérent +echo gmp_strval($div2) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +5 +2863311534 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-fact.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-fact.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-fact.xml:1.4 phpdoc-fr/reference/gmp/functions/gmp-fact.xml:1.5 --- phpdoc-fr/reference/gmp/functions/gmp-fact.xml:1.4 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-fact.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-fact' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-fact"> <refnamediv> <refname>gmp_fact</refname> @@ -19,6 +16,27 @@ <function>gmp_fact</function> calcule la factorielle de <parameter>a</parameter> : <literal>a!</literal>. </para> + <example> + <title>Exemple avec <function>gmp_fact</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$fact1 = gmp_fact(5); // 5 * 4 * 3 * 2 * 1 +echo gmp_strval($fact1) . "\n"; + +$fact2 = gmp_fact(50); // 50 * 49 * 48, ... etc +echo gmp_strval($fact2) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +120 +30414093201713378043612608166064768844377641568960512000000000000 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-gcd.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-gcd.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-gcd.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-gcd.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-gcd.xml:1.6 Sun Feb 29 19:23:23 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-gcd.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-gcd' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-gcd"> <refnamediv> <refname>gmp_gcd</refname> @@ -22,6 +19,23 @@ Le résultat est toujours positif, même si l'un des deux (ou les deux) nombres est négatif. </para> + <example> + <title>Exemple avec <function>gmp_gcd</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$gcd = gmp_gcd("12", "21"); +echo gmp_strval($gcd) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +3 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-gcdext.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-gcdext.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-gcdext.xml:1.7 phpdoc-fr/reference/gmp/functions/gmp-gcdext.xml:1.8 --- phpdoc-fr/reference/gmp/functions/gmp-gcdext.xml:1.7 Sun Feb 29 19:23:23 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-gcdext.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-gcdext' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.gmp-gcdext"> <refnamediv> <refname>gmp_gcdext</refname> @@ -20,26 +17,21 @@ <function>gmp_gcdext</function> calcule les entiers g, s, et t, tels que <literal>a*s + b*t = g = gcd(a,b)</literal>, où gcd est le pgcd de <parameter>a</parameter> et <parameter>b</parameter>. La fonction - retourne un tableau avec les index <literal>g</literal>, <literal>s</literal> + retourne un tableau avec les index <literal>g</literal>, <literal>s</literal> et <literal>t</literal>. </para> - <para> - Cette fonction peut être utilisée pour résoudre - des équations diophantines linéaires à deux - variables. Ces équations n'ont qu'une seule solution - entière, et elles sont de la forme : - <informalequation> - <alt>a*x + b*y = c</alt> - <graphic fileref="images/diophantine-equation.png"/> - </informalequation> - Pour plus d'informations, voyez les pages - <ulink url="&url.diophantine-equation;">"Diophantine Equation"</ulink> - sur MathWorld, en anglais. - </para> - <para> - <example> - <title>Résolution d'une équation Diophantine linéaire</title> - <programlisting role="php"> + <para> + Cette fonction peut être utilisée pour résoudre des équations diophantines + linéaires à deux variables. Ces équations n'ont qu'une seule solution + entière, et elles sont de la forme : <literal>a*x + b*y = c</literal>. + Pour plus d'informations, voyez les pages + <ulink url="&url.diophantine-equation;">"Diophantine Equation"</ulink> + sur MathWorld, en anglais. + </para> + <para> + <example> + <title>Résolution d'une équation Diophantine linéaire</title> + <programlisting role="php"> <![CDATA[ // Résolution de l'équation a*s + b*t = g // où a = 12, b = 21, g = gcd(12, 21) = 3 @@ -59,7 +51,7 @@ } else { echo "Erreur lors de la résolution de l'équation\n"; } - + // Résultat : Solution : 12*2 + 21*-1 = 3 ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-hamdist.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-hamdist.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-hamdist.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-hamdist.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-hamdist.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-hamdist.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-hamdist' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-hamdist"> <refnamediv> <refname>gmp_hamdist</refname> @@ -21,6 +18,33 @@ entre <parameter>a</parameter> et <parameter>b</parameter>. Les deux paramètres doivent être strictement positifs. </para> + <example> + <title>Exemple avec <function>gmp_hamdist</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$ham1 = gmp_init("1001010011", 2); +$ham2 = gmp_init("1011111100", 2); +echo gmp_hamdist($ham1, $ham2) . "\n"; + +/* hamdist est équivalent à : */ +echo gmp_popcount(gmp_xor($ham1, $ham2)) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +6 +6 +]]> + </screen> + </example> + <para> + Voir aussi + <function>gmp_popcount</function> et + <function>gmp_xor</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-init.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-init.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-init.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-init.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-init.xml:1.6 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-init.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-init' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-init"> <refnamediv> <refname>gmp_init</refname> @@ -27,26 +24,17 @@ <programlisting role="php"> <![CDATA[ <?php - $a = gmp_init (123456); - $b = gmp_init ("0xFFFFDEBACDFEDF7200"); +$a = gmp_init(123456); +$b = gmp_init("0xFFFFDEBACDFEDF7200"); ?> ]]> </programlisting> </example> </para> - <warning> - <simpara> - Si vous devez explicitement spécifier un entier de grande - taille, faites le avec une chaîne. Sinon, PHP va interpréter - l'entier littéralement, et vous y perdrez en précision avant - que les fonctions <literal>GMP</literal> n'entre en jeu. - </simpara> - </warning> <note> <para> Il n'est pas nécessaire d'appeler <function>gmp_init</function> - si vous voulez utiliser - des entiers ou des chaînes à la place de nombre GMP dans + si vous voulez utiliser des entiers ou des chaînes à la place de nombre GMP dans les fonctions GMP, comme par exemple <function>gmp_add</function>. Les arguments de ces fonctions sont automatiquement convertis en nombres GMP, si cette conversion est possible et nécessaire, en utilisant http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-intval.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-intval.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-intval.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-intval.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-intval.xml:1.6 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-intval.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-intval' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-intval"> <refnamediv> <refname>gmp_intval</refname> @@ -18,14 +15,39 @@ <para> <function>gmp_intval</function> convertit un nombre GMP en entier. <warning> - <simpara> - <function>gmp_intval</function> retourne un résultat cohérent - uniquement si le nombre GMP peut être représenté par un entier - PHP (i.e. type long signé). Si vous vous voulez simplement afficher - un nombre GMP, utilisez plutôt <function>gmp_strval</function>. - </simpara> + <simpara> + <function>gmp_intval</function> retourne un résultat cohérent + uniquement si le nombre GMP peut être représenté par un entier + PHP (i.e. type long signé). Si vous vous voulez simplement afficher + un nombre GMP, utilisez plutôt <function>gmp_strval</function>. + </simpara> </warning> </para> + <example> + <title>Exemple avec <function>gmp_intval</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// affiche le bon résultat +echo gmp_intval("2147483647") . "\n"; + +// affiche un mauvais résultat, hors de portée des entiers PHP +echo gmp_intval("2147483648") . "\n"; + +// affiche le bon résultat +echo gmp_strval("2147483648") . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +2147483647 +2147483647 +2147483648 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-invert.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-invert.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-invert.xml:1.4 phpdoc-fr/reference/gmp/functions/gmp-invert.xml:1.5 --- phpdoc-fr/reference/gmp/functions/gmp-invert.xml:1.4 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-invert.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-invert' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-invert"> <refnamediv> <refname>gmp_invert</refname> @@ -17,11 +14,30 @@ <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> - <function>gmp_invert</function> calcule l'inverse de - <parameter>a</parameter> modulo <parameter>b</parameter>. - <function>gmp_invert</function> retourne &false; si un tel - inverse n'existe pas. + <function>gmp_invert</function> calcule l'inverse de + <parameter>a</parameter> modulo <parameter>b</parameter>. + <function>gmp_invert</function> retourne &false; si un tel + inverse n'existe pas. </para> + <example> + <title>Exemple avec <function>gmp_invert</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo gmp_invert("5", "10"); // pas d'inverse, n'affiche rien, le résultat est FALSE +$invert = gmp_invert("5", "11"); +echo gmp_strval($invert) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +9 +]]> + </screen> + </example> + </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-jacobi.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-jacobi.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-jacobi.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-jacobi.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-jacobi.xml:1.6 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-jacobi.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-jacobi' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.gmp-jacobi"> <refnamediv> <refname>gmp_jacobi</refname> @@ -17,11 +14,29 @@ <methodparam><type>resource</type><parameter>p</parameter></methodparam> </methodsynopsis> <para> - <function>gmp_jacobi</function> calcule le - <ulink url="&url.jacobi;">symbole de Jacobi</ulink> de <parameter>a</parameter> et + <function>gmp_jacobi</function> calcule le <ulink + url="&url.jacobi;">symbole de Jacobi</ulink> de <parameter>a</parameter> et <parameter>p</parameter>. <parameter>p</parameter> doit être positif et impair. </para> + <example> + <title>Exemple avec <function>gmp_jacobi</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo gmp_jacobi("1", "3") . "\n"; +echo gmp_jacobi("2", "3") . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +1 +0 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-legendre.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-legendre.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-legendre.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-legendre.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-legendre.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-legendre.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-legendre' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-legendre"> <refnamediv> <refname>gmp_legendre</refname> @@ -17,12 +14,29 @@ <methodparam><type>resource</type><parameter>p</parameter></methodparam> </methodsynopsis> <para> - <function>gmp_legendre</function> calcule le - <ulink url="&url.symbole-legendre;"> - symbole de Legendre</ulink> de <parameter>a</parameter> et - <parameter>p</parameter>. <parameter>p</parameter> doit être positif et - impair. + <function>gmp_legendre</function> calcule le <ulink + url="&url.symbole-legendre;"> symbole de Legendre</ulink> de + <parameter>a</parameter> et <parameter>p</parameter>. + <parameter>p</parameter> doit être positif et impair. </para> + <example> + <title>Exemple avec <function>gmp_legendre</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo gmp_legendre("1", "3") . "\n"; +echo gmp_legendre("2", "3") . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +1 +0 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-mod.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-mod.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-mod.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-mod.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-mod.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-mod.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-mod' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-mod"> <refnamediv> <refname>gmp_mod</refname> @@ -21,6 +18,23 @@ <parameter>d</parameter>. Le résultat est toujours positif ou nul, car le signe de <parameter>d</parameter> est ignoré. </para> + <example> + <title>Exemple avec <function>gmp_mod</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$mod = gmp_mod("8", "3"); +echo gmp_strval($mod) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +2 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-mul.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-mul.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-mul.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-mul.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-mul.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-mul.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-mul' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-mul"> <refnamediv> <refname>gmp_mul</refname> @@ -18,8 +15,25 @@ </methodsynopsis> <para> <function>gmp_mul</function> multiplie les nombres GMP <parameter>a</parameter> - et <parameter>b</parameter>. Le résultat est un nombre GMP. + et <parameter>b</parameter>. </para> + <example> + <title>Exemple avec <function>gmp_mul</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$mul = gmp_mul("12345678", "2000"); +echo gmp_strval($mul) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +24691356000 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-neg.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-neg.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-neg.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-neg.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-neg.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-neg.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-neg' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.gmp-neg"> <refnamediv> <refname>gmp_neg</refname> @@ -19,6 +16,26 @@ <function>gmp_neg</function> retourne l'opposé de <parameter>a</parameter> (-1 * <parameter>a</parameter>). </para> + <example> + <title>Exemple avec <function>gmp_neg</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$neg1 = gmp_neg("1"); +echo gmp_strval($neg1) . "\n"; +$neg2 = gmp_neg("-1"); +echo gmp_strval($neg2) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +-1 +1 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-or.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-or.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-or.xml:1.4 phpdoc-fr/reference/gmp/functions/gmp-or.xml:1.5 --- phpdoc-fr/reference/gmp/functions/gmp-or.xml:1.4 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-or.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-or' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-or"> <refnamediv> <refname>gmp_or</refname> @@ -20,6 +17,26 @@ <function>gmp_or</function> calcule le OU logique de <parameter>a</parameter> et <parameter>b</parameter>. </para> + <example> + <title>Exemple avec <function>gmp_or</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$or1 = gmp_or("0xfffffff2", "4"); +echo gmp_strval($or1, 16) . "\n"; +$or2 = gmp_or("0xfffffff2", "2"); +echo gmp_strval($or2, 16) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +fffffff6 +fffffff2 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-perfect-square.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-perfect-square.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-perfect-square.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-perfect-square.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-perfect-square.xml:1.6 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-perfect-square.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-perfect-square' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-perfect-square"> <refnamediv> <refname>gmp_perfect_square</refname> @@ -16,14 +13,39 @@ <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - <function>gmp_perfect_square</function> retourn &true; si - <parameter>a</parameter> est un carré parfait, et &false; sinon. + <function>gmp_perfect_square</function> retourne &true; si + <parameter>a</parameter> est un carré parfait, et &false; sinon. + </para> + <example> + <title><function>gmp_perfect_square</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// 3 * 3, carré parfait +var_dump(gmp_perfect_square("9")); + +// pas un carré parfait +var_dump(gmp_perfect_square("7")); + +// 1234567890 * 1234567890, carré parfait +var_dump(gmp_perfect_square("1524157875019052100")); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +bool(true) +bool(false) +bool(true) +]]> + </screen> + </example> + <para> + Voir aussi + <function>gmp_sqrt</function> et + <function>gmp_sqrtrm</function>. </para> - <para> - Voir aussi - <function>gmp_sqrt</function> et - <function>gmp_sqrtrm</function>. - </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-popcount.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-popcount.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-popcount.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-popcount.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-popcount.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-popcount.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-popcount' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-popcount"> <refnamediv> <refname>gmp_popcount</refname> @@ -19,6 +16,26 @@ <function>gmp_popcount</function> dénombre la population de <parameter>a</parameter>. </para> + <example> + <title>Exemple avec <function>gmp_popcount</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$pop1 = gmp_init("10000101", 2); // 3 1's +echo gmp_popcount($pop1) . "\n"; +$pop2 = gmp_init("11111110", 2); // 7 1's +echo gmp_popcount($pop2) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +3 +7 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-pow.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-pow.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-pow.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-pow.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-pow.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-pow.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-pow' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-pow"> <refnamediv> <refname>gmp_pow</refname> @@ -17,12 +14,33 @@ <methodparam><type>int</type><parameter>exp</parameter></methodparam> </methodsynopsis> <para> - <function>gmp_pow</function> élève - <parameter>base</parameter> à la puissance - <parameter>exp</parameter>. Dans le cas de 0^0, - <function>gmp_pow</function> retourne 1.<parameter>exp</parameter> + <function>gmp_pow</function> élève <parameter>base</parameter> à la + puissance <parameter>exp</parameter>. Dans le cas de 0^0, + <function>gmp_pow</function> retourne 1. <parameter>exp</parameter> ne doit pas être négatif. </para> + <example> + <title>Exemple avec <function>gmp_pow</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$pow1 = gmp_pow("2", 31); +echo gmp_strval($pow1) . "\n"; +$pow2 = gmp_pow("0", 0); +echo gmp_strval($pow2) . "\n"; +$pow3 = gmp_pow("2", -1); // Négatif, génère un warning +echo gmp_strval($pow3) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +2147483648 +1 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-powm.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-powm.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-powm.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-powm.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-powm.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-powm.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-powm' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-powm"> <refnamediv> <refname>gmp_powm</refname> @@ -23,6 +20,23 @@ <parameter>exp</parameter> est négatif, le résultat est indéfini. </para> + <example> + <title>Exemple avec <function>gmp_powm</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$pow1 = gmp_powm("2", "31", "2147483649"); +echo gmp_strval($pow1) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +2147483648 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-prob-prime.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-prob-prime.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-prob-prime.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-prob-prime.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-prob-prime.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-prob-prime.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-prob-prime' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-prob-prime"> <refnamediv> <refname>gmp_prob_prime</refname> @@ -30,6 +27,31 @@ <function>gmp_prob_prime</function> utilise le test de probabilité Miller-Rabin. </para> + <example> + <title>Exemple avec <function>gmp_prob_prime</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// pas premier +echo gmp_prob_prime("6") . "\n"; + +// probablement premier +echo gmp_prob_prime("1111111111111111111") . "\n"; + +// premier +echo gmp_prob_prime("11") . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +0 +1 +2 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-random.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-random.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-random.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-random.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-random.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-random.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-random' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-random"> <refnamediv> <refname>gmp_random</refname> @@ -17,10 +14,39 @@ </methodsynopsis> <para> <function>gmp_random</function> génère un nombre aléatoire. - Ce nombre est limité par <parameter>limiter</parameter>. Si + Ce nombre sera compris entre zéro et le nombre de bits par limb + multiplié par <parameter>limiter</parameter>. Si <parameter>limiter</parameter> est négatif, un nombre négatif est généré. </para> + <para> + Un limb est un méchanisme interne de GMP. Le nombre de bits dans un limb + n'est pas statique, et peut varier entre les systèmes. En général, le nombre + de bits par limb est 16 ou 32, mais ce n'est pas garantit. + </para> + <example> + <title>Exemple avec <function>gmp_random</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$rand1 = gmp_random(1); // nombre aléatoire de 0 à 1 * bits per limb +$rand2 = gmp_random(2); // nombre aléatoire de 0 à 2 * bits per limb + +echo gmp_strval($rand1) . "\n"; +echo gmp_strval($rand2) . "\n"; +?> +]]> + </programlisting> + <para> + Cet exemple peut afficher : + </para> + <screen> +<![CDATA[ +1915834968 +8642564075890328087 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-scan0.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-scan0.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-scan0.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-scan0.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-scan0.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-scan0.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-scan0' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-scan0"> <refnamediv> <refname>gmp_scan0</refname> @@ -22,6 +19,29 @@ de poids lourd, jusqu'à ce qu'elle rencontre un bit à 0. Sa position est alors retournée. </para> + <example> + <title>Exemple avec <function>gmp_scan0</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// le bit "0" est trouvé à la position 3. l'index commence à 0 +$s1 = gmp_init("10111", 2); +echo gmp_scan0($s1, 0) . "\n"; + +// le bit "0" est trouvé à la position 7. l'index commence à 5 +$s2 = gmp_init("101110000", 2); +echo gmp_scan0($s2, 5) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +3 +7 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-scan1.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-scan1.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-scan1.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-scan1.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-scan1.xml:1.6 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-scan1.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-scan1' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.gmp-scan1"> <refnamediv> <refname>gmp_scan1</refname> @@ -23,6 +20,29 @@ un bit à 1. Sa position est alors retournée. Si aucun bit n'est trouvé, <function>gmp_scan1</function> retourne -1. </para> + <example> + <title>Exemple avec <function>gmp_scan1</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// "1" bit est trouvé à la position 3. l'index commence à 0 +$s1 = gmp_init("01000", 2); +echo gmp_scan1($s1, 0) . "\n"; + +// "1" bit est trouvé à la position 9. l'index commence à 5 +$s2 = gmp_init("01000001111", 2); +echo gmp_scan1($s2, 5) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +3 +9 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-setbit.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-setbit.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-setbit.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-setbit.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-setbit.xml:1.6 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-setbit.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-setbit' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.gmp-setbit"> <refnamediv> <refname>gmp_setbit</refname> @@ -19,8 +16,36 @@ </methodsynopsis> <para> <function>gmp_setbit</function> modifie le bit <parameter>index</parameter> - dans <parameter>a</parameter>. <parameter>set_clear</parameter> indique si - le bit est mis à 0 ou 1. Par défaut, il est mis à 1. + dans <parameter>a</parameter>. + </para> + <note> + <para> + Contrairement à la plupart des autres fonctions GMP, + <function>gmp_setbit</function> doit être appelée avec une ressource + GMP existant déjà (en utilisant <function>gmp_init</function> par + exemple). Elle ne sera pas automatiquement créée. + </para> + </note> + <example> + <title>Exemple avec <function>gmp_setbit</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$a = gmp_init("0xfd"); +gmp_setbit($a, 1); // l'index commence à zéro +echo gmp_strval($a) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +255 +]]> + </screen> + </example> + <para> + Voir aussi <function>gmp_clrbit</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-sign.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-sign.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-sign.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-sign.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-sign.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-sign.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-sign' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-sign"> <refnamediv> <refname>gmp_sign</refname> @@ -17,8 +14,34 @@ </methodsynopsis> <para> <function>gmp_sign</function> retourne le signe de <parameter>a</parameter> : - 1 si <parameter>a</parameter> est positif et -1 s'il est négatif. + 1 si <parameter>a</parameter> est positif, -1 s'il est négatif et 0 si + <parameter>a</parameter> est égal à zéro. </para> + <example> + <title>Exemple avec <function>gmp_sign</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// positive +echo gmp_sign("500") . "\n"; + +// negative +echo gmp_sign("-500") . "\n"; + +// zero +echo gmp_sign("0") . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +1 +-1 +0 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-sqrt.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-sqrt.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-sqrt.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-sqrt.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-sqrt.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-sqrt.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-sqrt' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-sqrt"> <refnamediv> <refname>gmp_sqrt</refname> @@ -19,6 +16,30 @@ <function>gmp_sqrt</function> calcule la racine carrée de <parameter>a</parameter>. </para> + <example> + <title>Exemple avec <function>gmp_sqrt</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$sqrt1 = gmp_sqrt("9"); +$sqrt2 = gmp_sqrt("7"); +$sqrt3 = gmp_sqrt("1524157875019052100"); + +echo gmp_strval($sqrt1) . "\n"; +echo gmp_strval($sqrt2) . "\n"; +echo gmp_strval($sqrt3) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +3 +2 +1234567890 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-sqrtrem.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-sqrtrem.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-sqrtrem.xml:1.3 phpdoc-fr/reference/gmp/functions/gmp-sqrtrem.xml:1.4 --- phpdoc-fr/reference/gmp/functions/gmp-sqrtrem.xml:1.3 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-sqrtrem.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-sqrtrm' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.gmp-sqrtrem"> <refnamediv> <refname>gmp_sqrtrem</refname> @@ -22,6 +19,30 @@ le second est le reste de (i.e., la différence entre <parameter>a</parameter> et le carré du premier élément). </para> + <example> + <title>Exemple avec <function>gmp_sqrtrem</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +list($sqrt1, $sqrt1rem) = gmp_sqrtrem("9"); +list($sqrt2, $sqrt2rem) = gmp_sqrtrem("7"); +list($sqrt3, $sqrt3rem) = gmp_sqrtrem("1048576"); + +echo gmp_strval($sqrt1) . ", " . gmp_strval($sqrt1rem) . "\n"; +echo gmp_strval($sqrt2) . ", " . gmp_strval($sqrt2rem) . "\n"; +echo gmp_strval($sqrt3) . ", " . gmp_strval($sqrt3rem) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +3, 0 +2, 3 +1024, 0 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-strval.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-strval.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-strval.xml:1.6 phpdoc-fr/reference/gmp/functions/gmp-strval.xml:1.7 --- phpdoc-fr/reference/gmp/functions/gmp-strval.xml:1.6 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-strval.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-strval' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-strval"> <refnamediv> <refname>gmp_strval</refname> @@ -13,8 +10,8 @@ <title>Description</title> <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> <function>gmp_strval</function> convertit un nombre GMP en @@ -27,9 +24,9 @@ <programlisting role="php"> <![CDATA[ <?php - $a = gmp_init("0x41682179fbf5"); - printf("Décimal: %s, base 36: %s", - gmp_strval($a), gmp_strval($a,36)); +$a = gmp_init("0x41682179fbf5"); +printf("Décimal : %s, base 36: %s", + gmp_strval($a), gmp_strval($a, 36)); ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-sub.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-sub.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-sub.xml:1.5 phpdoc-fr/reference/gmp/functions/gmp-sub.xml:1.6 --- phpdoc-fr/reference/gmp/functions/gmp-sub.xml:1.5 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-sub.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-sub' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: didou Status: ready --> <refentry id="function.gmp-sub"> <refnamediv> <refname>gmp_sub</refname> @@ -20,6 +17,23 @@ <function>gmp_sub</function> soustrait le nombre GMP <parameter>b</parameter> de <parameter>a</parameter>. Le résultat est un nombre GMP. </para> + <example> + <title>Exemple avec <function>gmp_sub</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$sub = gmp_sub("281474976710656", "4294967296"); // 2^48 - 2^32 +echo gmp_strval($sub) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +281470681743360 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/gmp/functions/gmp-xor.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-fr/reference/gmp/functions/gmp-xor.xml diff -u phpdoc-fr/reference/gmp/functions/gmp-xor.xml:1.4 phpdoc-fr/reference/gmp/functions/gmp-xor.xml:1.5 --- phpdoc-fr/reference/gmp/functions/gmp-xor.xml:1.4 Tue Feb 24 13:09:57 2004 +++ phpdoc-fr/reference/gmp/functions/gmp-xor.xml Mon Apr 26 10:06:57 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/gmp.xml, last change in rev 1.10 --> -<!-- last change to 'gmp-xor' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.gmp-xor"> <refnamediv> <refname>gmp_xor</refname> @@ -20,6 +17,27 @@ <function>gmp_or</function> calcule le OU exclusif logique de <parameter>a</parameter> et <parameter>b</parameter>. </para> + <example> + <title>Exemple avec <function>gmp_xor</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$xor1 = gmp_init("1101101110011101", 2); +$xor2 = gmp_init("0110011001011001", 2); + +$xor3 = gmp_xor($xor1, $xor2); + +echo gmp_strval($xor3, 2) . "\n"; +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +1011110111000100 +]]> + </screen> + </example> </refsect1> </refentry>
« previous php.doc.fr (#2327) next »