cvs: phpdoc-es /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

From: Date: Wed, 06 Jul 2005 17:17:37 +0000
Subject: cvs: phpdoc-es /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
Groups: php.doc.es 
Request: Send a blank email to doc-es+get-1123@lists.php.net to get a copy of this message
javi Wed Jul 6 13:17:37 2005 EDT Added files: /phpdoc-es/reference/gmp/functions gmp-com.xml Modified files: /phpdoc-es/reference/gmp/functions gmp-div-q.xml gmp-abs.xml gmp-hamdist.xml gmp-div.xml gmp-gcdext.xml gmp-div-r.xml gmp-fact.xml gmp-and.xml gmp-divexact.xml gmp-clrbit.xml gmp-div-qr.xml gmp-add.xml gmp-cmp.xml gmp-gcd.xml Log: - Añadido EN-Revision - Redactado de nuevo por completo - Añadido ejemplo al final

http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-div-q.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-div-q.xml diff -u phpdoc-es/reference/gmp/functions/gmp-div-q.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-div-q.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-div-q.xml:1.1 Sun Apr 14 20:14:14 2002 +++ phpdoc-es/reference/gmp/functions/gmp-div-q.xml Wed Jul 6 13:17:36 2005 @@ -1,50 +1,85 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-div-q' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-div-q"> <refnamediv> <refname>gmp_div_q</refname> - <refpurpose>Divide numbers</refpurpose> + <refpurpose>Divide n&uacute;meros</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <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 choice="opt"><type>int</type><parameter>redondeo</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: + Divide <parameter>a</parameter> por <parameter>b</parameter> y devuelve + el resultado entero. El redondeo del resultado se define mediante el + par&aacute;metro <parameter>redondeo</parameter>, que puede tomar uno de los + siguiente valores: <itemizedlist> <listitem> <simpara> - <parameter>GMP_ROUND_ZERO</parameter>: The result is truncated - towards 0. + <parameter>GMP_ROUND_ZERO</parameter>: El resultado se trunca a 0. </simpara> </listitem> <listitem> <simpara> - <parameter>GMP_ROUND_PLUSINF</parameter>: The result is - rounded towards <literal>+infinity</literal>. + <parameter>GMP_ROUND_PLUSINF</parameter>: El resultado se redondea + hacia <literal>+infinito</literal>. </simpara> </listitem> <listitem> <simpara> - <parameter>GMP_ROUND_MINUSINF</parameter>: The result is - rounded towards <literal>-infinity</literal>. + <parameter>GMP_ROUND_MINUSINF</parameter>: El resultado se redondea + hacia <literal>-infinito</literal>. </simpara> </listitem> </itemizedlist> </para> <simpara> - This function can also be called as <function>gmp_div</function>. + Esta funci&oacute;n tambi&eacute;n se puede llamar con <function>gmp_div</function>. </simpara> + <example> + <title>Ejemplo de <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> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +20 +0 +1 +0 +1 +]]> + </screen> + </example> <para> - See also <function>gmp_div_r</function>, + Vea tambi&eacute;n <function>gmp_div_r</function> y <function>gmp_div_qr</function> </para> </refsect1> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-abs.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-abs.xml diff -u phpdoc-es/reference/gmp/functions/gmp-abs.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-abs.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-abs.xml:1.1 Sun Apr 14 20:14:13 2002 +++ phpdoc-es/reference/gmp/functions/gmp-abs.xml Wed Jul 6 13:17:36 2005 @@ -1,20 +1,44 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-abs' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-abs"> <refnamediv> <refname>gmp_abs</refname> - <refpurpose>Absolute value</refpurpose> + <refpurpose>Valor absoluto</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <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>. + Devuelve el valor absoluto del par&aacute;metro <parameter>a</parameter>. </para> + <example> + <title>Ejemplo de <function>gmp_abs</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$abs1 = gmp_abs("274982683358"); +$abs2 = gmp_abs("-274982683358"); + +echo gmp_strval($abs1) . "\n"; +echo gmp_strval($abs2) . "\n"; +?> +]]> + </programlisting> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +274982683358 +274982683358 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-hamdist.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-hamdist.xml diff -u phpdoc-es/reference/gmp/functions/gmp-hamdist.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-hamdist.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-hamdist.xml:1.1 Sun Apr 14 20:14:15 2002 +++ phpdoc-es/reference/gmp/functions/gmp-hamdist.xml Wed Jul 6 13:17:36 2005 @@ -1,21 +1,50 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-hamdist' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-hamdist"> <refnamediv> <refname>gmp_hamdist</refname> - <refpurpose>Hamming distance</refpurpose> + <refpurpose>Distancia de Hamming</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <methodsynopsis> <type>int</type><methodname>gmp_hamdist</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> - Returns the hamming distance between <parameter>a</parameter> and - <parameter>a</parameter>. Both operands should be non-negative. + Devuelve la distancia Hamming entre <parameter>a</parameter> y + <parameter>b</parameter>. Los 2 operandos deben ser no negativos. + </para> + <example> + <title>Ejemplo de <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 es equivalente a: */ +echo gmp_popcount(gmp_xor($ham1, $ham2)) . "\n"; +?> +]]> + </programlisting> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +6 +6 +]]> + </screen> + </example> + <para> + Vea tambi&eacute;n <function>gmp_popcount</function> y + <function>gmp_xor</function> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-div.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-div.xml diff -u phpdoc-es/reference/gmp/functions/gmp-div.xml:1.2 phpdoc-es/reference/gmp/functions/gmp-div.xml:1.3 --- phpdoc-es/reference/gmp/functions/gmp-div.xml:1.2 Mon Sep 13 07:32:22 2004 +++ phpdoc-es/reference/gmp/functions/gmp-div.xml Wed Jul 6 13:17:36 2005 @@ -1,23 +1,21 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-div' in en/ tree in rev 1.1 --> - <refentry id="function.gmp-div"> - <refnamediv> - <refname>gmp_div</refname> - <refpurpose>Divide numbers</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> - This function is an alias to <function>gmp_div_q</function>. - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> +<refentry id="function.gmp-div"> + <refnamediv> + <refname>gmp_div</refname> + <refpurpose>&Alias; <function>gmp_div_q</function></refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <simpara> + &info.function.alias; + <function>gmp_div_q</function>. + </simpara> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-gcdext.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-gcdext.xml diff -u phpdoc-es/reference/gmp/functions/gmp-gcdext.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-gcdext.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-gcdext.xml:1.1 Sun Apr 14 20:14:14 2002 +++ phpdoc-es/reference/gmp/functions/gmp-gcdext.xml Wed Jul 6 13:17:36 2005 @@ -1,22 +1,62 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-gcdext' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-gcdext"> <refnamediv> <refname>gmp_gcdext</refname> - <refpurpose>Calculate GCD and multipliers</refpurpose> + <refpurpose>Calcula el MCD y los divisores</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <methodsynopsis> <type>array</type><methodname>gmp_gcdext</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> - Calculates g, s, and t, such that <literal>a*s + b*t = g = - gcd(a,b)</literal>, where gcd is gretest common divisor. Returns - array with respective elements g, s and t. + Calcula g, s y t, tales que cumplen que <literal>a*s + b*t = g = + mcd(a,b)</literal>, donde mcd es el m&aacute;ximo com&uacute;n divisor. + Devuelve una matriz con los elementos g, s y t. + </para> + <para> + La funci&oacute;n se puede emplear para resolver ecuaciones Diof&aacute;nticas + lineales con 2 variables. Este tipo de ecuaciones solamente permiten soluciones + enteras y son de la forma: + <literal>a*x + b*y = c</literal>. + Para m&aacute;s informaci&oacute;n, puede visitar la direcci&oacute;n + <ulink url="&url.diophantine-equation;">"Diophantine Equation" de MathWorld</ulink> + </para> + <para> + <example> + <title>Resoluci&oacute;n de una ecuaci&oacute;n Diof&aacute;ntica lineal</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Resolver la ecuacion a*s + b*t = g +// donde a = 12, b = 21, g = mcd(12, 21) = 3 +$a = gmp_init(12); +$b = gmp_init(21); +$g = gmp_gcd($a, $b); +$r = gmp_gcdext($a, $b); + +$comprueba_mcd = (gmp_strval($g) == gmp_strval($r['g'])); +$resultado_ecuacion = gmp_add(gmp_mul($a, $r['s']), gmp_mul($b, $r['t'])); +$comprueba_resultado = (gmp_strval($g) == gmp_strval($eq_res)); + +if ($comprueba_mcd && $comprueba_resultado) { + $fmt = "Solucion: %d*%d + %d*%d = %d\n"; + printf($fmt, gmp_strval($a), gmp_strval($r['s']), gmp_strval($b), + gmp_strval($r['t']), gmp_strval($r['g'])); +} else { + echo "Error al intentar resolver la ecuacion\n"; +} + +// Salida: Solution: 12*2 + 21*-1 = 3 +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-div-r.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-div-r.xml diff -u phpdoc-es/reference/gmp/functions/gmp-div-r.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-div-r.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-div-r.xml:1.1 Sun Apr 14 20:14:14 2002 +++ phpdoc-es/reference/gmp/functions/gmp-div-r.xml Wed Jul 6 13:17:36 2005 @@ -1,32 +1,51 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-div-r' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-div-r"> <refnamediv> <refname>gmp_div_r</refname> - <refpurpose>Remainder of the division of numbers</refpurpose> + <refpurpose>Resto de la divisi&oacute;n de n&uacute;meros</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <methodsynopsis> <type>resource</type><methodname>gmp_div_r</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> <methodparam><type>resource</type><parameter>d</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>round</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>redondeo</parameter></methodparam> </methodsynopsis> <para> - Calculates remainder of the integer division of - <parameter>n</parameter> by <parameter>d</parameter>. The - remainder has the sign of the <parameter>n</parameter> argument, - if not zero. + Calcula el resto de la divisi&oacute;n entera de + <parameter>n</parameter> por <parameter>d</parameter>. El resto tiene + el signo del par&aacute;metro <parameter>n</parameter>, siempre que + sea distinto de cero. </para> + <example> + <title>Ejemplo de <function>gmp_div_r</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$div = gmp_div_r("105", "20"); +echo gmp_strval($div) . "\n"; +?> +]]> + </programlisting> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +5 +]]> + </screen> + </example> <para> - See the <function>gmp_div_q</function> function for description - of the <parameter>round</parameter> argument. + Vea tambi&eacute;n <function>gmp_div_q</function> para una descripci&oacute;n + del par&aacute;metro <parameter>redondeo</parameter>. </para> <para> - See also <function>gmp_div_q</function>, - <function>gmp_div_qr</function> + Vea tambi&eacute;n <function>gmp_div_q</function> y <function>gmp_div_qr</function> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-fact.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-fact.xml diff -u phpdoc-es/reference/gmp/functions/gmp-fact.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-fact.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-fact.xml:1.1 Sun Apr 14 20:14:14 2002 +++ phpdoc-es/reference/gmp/functions/gmp-fact.xml Wed Jul 6 13:17:36 2005 @@ -1,20 +1,44 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-fact' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-fact"> <refnamediv> <refname>gmp_fact</refname> <refpurpose>Factorial</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <methodsynopsis> <type>resource</type><methodname>gmp_fact</methodname> <methodparam><type>int</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> - Calculates factorial (<literal>a!</literal>) of <parameter>a</parameter>. + Calcula el factorial de <parameter>a</parameter> (<literal>a!</literal>). </para> + <example> + <title>Ejemplo de <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> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +120 +30414093201713378043612608166064768844377641568960512000000000000 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-and.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-and.xml diff -u phpdoc-es/reference/gmp/functions/gmp-and.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-and.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-and.xml:1.1 Sun Apr 14 20:14:13 2002 +++ phpdoc-es/reference/gmp/functions/gmp-and.xml Wed Jul 6 13:17:36 2005 @@ -1,21 +1,44 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-and' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-and"> <refnamediv> <refname>gmp_and</refname> - <refpurpose>Logical AND</refpurpose> + <refpurpose>Realiza una operaci&oacute;n de AND l&oacute;gico</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <methodsynopsis> <type>resource</type><methodname>gmp_and</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> <methodparam><type>resource</type><parameter>b</parameter></methodparam> </methodsynopsis> <para> - Calculates logical AND of two GMP numbers. + Calcula el AND l&oacute;gico de 2 n&uacute;meros GMP. </para> + <example> + <title>Ejemplo de <function>gmp_and</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$and1 = gmp_and("0xfffffffff4", "0x4"); +$and2 = gmp_and("0xfffffffff4", "0x8"); +echo gmp_strval($and1) . "\n"; +echo gmp_strval($and2) . "\n"; +?> +]]> + </programlisting> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +4 +0 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-divexact.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-divexact.xml diff -u phpdoc-es/reference/gmp/functions/gmp-divexact.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-divexact.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-divexact.xml:1.1 Sun Apr 14 20:14:14 2002 +++ phpdoc-es/reference/gmp/functions/gmp-divexact.xml Wed Jul 6 13:17:36 2005 @@ -1,24 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-divexact' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-divexact"> <refnamediv> <refname>gmp_divexact</refname> - <refpurpose>Exact division of numbers</refpurpose> + <refpurpose>Divisi&oacute;n exacta de n&uacute;meros</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <methodsynopsis> <type>resource</type><methodname>gmp_divexact</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> <methodparam><type>resource</type><parameter>d</parameter></methodparam> </methodsynopsis> <para> - Divides <parameter>n</parameter> by <parameter>d</parameter>, - using fast "exact division" algorithm. This function produces - correct results only when it is known in advance that - <parameter>d</parameter> divides <parameter>n</parameter>. + Divide <parameter>n</parameter> por <parameter>d</parameter>, + usando un algoritmo r&aacute;pido de "divisi&oacute;n exacta". + La funci&oacute;n solamente produce resultados correctos + cuando se sabe a priori que <parameter>d</parameter> es un + factor de <parameter>n</parameter>. </para> + <example> + <title>Ejemplo de <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"); // resultado inexacto +echo gmp_strval($div2) . "\n"; +?> +]]> + </programlisting> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +5 +2863311534 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-clrbit.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-clrbit.xml diff -u phpdoc-es/reference/gmp/functions/gmp-clrbit.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-clrbit.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-clrbit.xml:1.1 Sun Apr 14 20:14:13 2002 +++ phpdoc-es/reference/gmp/functions/gmp-clrbit.xml Wed Jul 6 13:17:36 2005 @@ -1,21 +1,53 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-clrbit' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.6 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-clrbit"> <refnamediv> <refname>gmp_clrbit</refname> - <refpurpose>Clear bit</refpurpose> + <refpurpose>Borra un bit</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <methodsynopsis> <type>resource</type><methodname>gmp_clrbit</methodname> <methodparam><type>resource</type><parameter>&amp;a</parameter></methodparam> - <methodparam><type>int</type><parameter>index</parameter></methodparam> + <methodparam><type>int</type><parameter>indice</parameter></methodparam> </methodsynopsis> <para> - Clears (sets to 0) bit <parameter>index</parameter> in - <parameter>a</parameter>. + Borra (poni&eacute;ndolo a 0) el bit que ocupa la posici&oacute;n <parameter>indice</parameter> + dentro de <parameter>a</parameter>. + </para> + <note> + <para> + Al contrario que para la mayor&iacute;a de funciones GMP, <function>gmp_clrbit</function> + debe ser invocada con un recurso GMP que ya exista (creado por ejemplo con la + funci&oacute;n <function>gmp_init</function>), ya que no se crea uno de forma + autom&aacute;tica. + </para> + </note> + <example> + <title>Ejemplo de <function>gmp_clrbit</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$a = gmp_init("0xff"); +gmp_clrbit($a, 0); // los indices comienza en el 0 para el bit menos significativo +echo gmp_strval($a) . "\n"; +?> +]]> + </programlisting> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +254 +]]> + </screen> + </example> + <para> + Vea tambi&eacute;n <function>gmp_setbit</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-div-qr.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-div-qr.xml diff -u phpdoc-es/reference/gmp/functions/gmp-div-qr.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-div-qr.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-div-qr.xml:1.1 Sun Apr 14 20:14:14 2002 +++ phpdoc-es/reference/gmp/functions/gmp-div-qr.xml Wed Jul 6 13:17:36 2005 @@ -1,46 +1,48 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-div-qr' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-div-qr"> <refnamediv> <refname>gmp_div_qr</refname> - <refpurpose>Divide numbers and get quotient and remainder</refpurpose> + <refpurpose>Divide n&uacute;meros y obtiene el cociente y el resto</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <methodsynopsis> <type>array</type><methodname>gmp_div_qr</methodname> <methodparam><type>resource</type><parameter>n</parameter></methodparam> <methodparam><type>resource</type><parameter>d</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>round</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>redondeo</parameter></methodparam> </methodsynopsis> <para> - The function divides <parameter>n</parameter> by - <parameter>d</parameter> and returns array, 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). + La funci&oacute;n divide <parameter>n</parameter> por + <parameter>d</parameter> y devuelve una matriz en la que el primer + elemento es <literal>[n/d]</literal> (el resultado entero de la divisi&oacute;n) + y el segundo elemento es <literal>(n - [n/d] * d)</literal> (el resto + de la divisi&oacute;n). </para> <para> - See the <function>gmp_div_q</function> function for description - of the <parameter>round</parameter> argument. + Vea tambi&eacute;n <function>gmp_div_q</function> para una descripci&oacute;n + del par&aacute;metro <parameter>redondeo</parameter>. </para> <para> <example> - <title>Division of GMP numbers</title> + <title>Divisi&oacute;n de n&uacute;meros GMP</title> <programlisting role="php"> -&lt;?php - $a = gmp_init ("0x41682179fbf5"); - $res = gmp_div_qr ($a, "0xDEFE75"); - printf("Result is: q - %s, r - %s", - gmp_strval ($res[0]), gmp_strval ($res[1])); +<![CDATA[ +<?php +$a = gmp_init("0x41682179fbf5"); +$resultado = gmp_div_qr($a, "0xDEFE75"); +printf("El resultado es: cociente - %s, resto - %s", + gmp_strval($resultado[0]), gmp_strval($resultado[1])); ?> +]]> </programlisting> </example> </para> <para> - See also <function>gmp_div_q</function>, - <function>gmp_div_r</function>. + Vea tambi&eacute;n <function>gmp_div_q</function> y <function>gmp_div_r</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-add.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-add.xml diff -u phpdoc-es/reference/gmp/functions/gmp-add.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-add.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-add.xml:1.1 Sun Apr 14 20:14:13 2002 +++ phpdoc-es/reference/gmp/functions/gmp-add.xml Wed Jul 6 13:17:36 2005 @@ -1,22 +1,42 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-add' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-add"> <refnamediv> <refname>gmp_add</refname> - <refpurpose>Add numbers</refpurpose> + <refpurpose>Suma n&uacute;meros</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <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 GMP number representing - the sum of the arguments. + Suma 2 n&uacute;meros GMP. El resultado es un n&uacute;mero GMP que representa + la suma de los argumentos. </para> + <example> + <title>Ejemplo de <function>gmp_add</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$suma = gmp_add("123456789012345", "76543210987655"); +echo gmp_strval($suma) . "\n"; +?> +]]> + </programlisting> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +200000000000000 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-cmp.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-cmp.xml diff -u phpdoc-es/reference/gmp/functions/gmp-cmp.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-cmp.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-cmp.xml:1.1 Sun Apr 14 20:14:14 2002 +++ phpdoc-es/reference/gmp/functions/gmp-cmp.xml Wed Jul 6 13:17:36 2005 @@ -1,23 +1,45 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-cmp' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-cmp"> <refnamediv> <refname>gmp_cmp</refname> - <refpurpose>Compare numbers</refpurpose> + <refpurpose>Compara n&uacute;meros</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <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> - Returns positive value if <literal>a > b</literal>, zero if - <literal>a = b</literal> and negative value if <literal>a &lt; - b</literal>. + Devuelve un valor positivo si <literal>a &gt; b</literal>, cero si + <literal>a = b</literal> y un valor negativo si <literal>a &lt; b</literal>. </para> + <example> + <title>Ejemplo de <function>gmp_cmp</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$cmp1 = gmp_cmp("1234", "1000"); // mayor que +$cmp2 = gmp_cmp("1000", "1234"); // menor que +$cmp3 = gmp_cmp("1234", "1234"); // igual a + +echo "$cmp1 $cmp2 $cmp3\n"; +?> +]]> + </programlisting> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +1 -1 0 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/gmp/functions/gmp-gcd.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/gmp/functions/gmp-gcd.xml diff -u phpdoc-es/reference/gmp/functions/gmp-gcd.xml:1.1 phpdoc-es/reference/gmp/functions/gmp-gcd.xml:1.2 --- phpdoc-es/reference/gmp/functions/gmp-gcd.xml:1.1 Sun Apr 14 20:14:14 2002 +++ phpdoc-es/reference/gmp/functions/gmp-gcd.xml Wed Jul 6 13:17:36 2005 @@ -1,23 +1,43 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/gmp.xml, last change in rev 1.1 --> -<!-- last change to 'gmp-gcd' in en/ tree in rev 1.1 --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> +<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 --> <refentry id="function.gmp-gcd"> <refnamediv> <refname>gmp_gcd</refname> - <refpurpose>Calculate GCD</refpurpose> + <refpurpose>Calcula el MCD (m&aacute;ximo com&uacute;n divisor)</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descripci&oacute;n</title> <methodsynopsis> <type>resource</type><methodname>gmp_gcd</methodname> <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. + Calcula el divisor com&uacute; m&aacute;s grande de <parameter>a</parameter> y + <parameter>b</parameter>. El resultado siempre es positivo, incluso aunque + alguno de los par&aacute;metros (o los dos) se negativo. </para> + <example> + <title>Ejemplo de <function>gmp_gcd</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$mcd = gmp_gcd("12", "21"); +echo gmp_strval($mcd) . "\n"; +?> +]]> + </programlisting> + <para> + La salida del anterior programa es: + </para> + <screen> +<![CDATA[ +3 +]]> + </screen> + </example> </refsect1> </refentry> http://cvs.php.net/co.php/phpdoc-es/reference/gmp/functions/gmp-com.xml?r=1.1&p=1 Index: phpdoc-es/reference/gmp/functions/gmp-com.xml +++ phpdoc-es/reference/gmp/functions/gmp-com.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> <!-- EN-Revision: 1.4 Maintainer: javi Status: ready --> <!-- splitted from ./en/functions/gmp.xml, last change in rev 1.20 --> <refentry id='function.gmp-com'> <refnamediv> <refname>gmp_com</refname> <refpurpose>Calcula el complementario</refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <methodsynopsis> <type>resource</type><methodname>gmp_com</methodname> <methodparam><type>resource</type><parameter>a</parameter></methodparam> </methodsynopsis> <para> Devuelve el complementario a 1 de <parameter>a</parameter>. </para> <example> <title>Ejemplo de <function>gmp_com</function></title> <programlisting role="php"> <![CDATA[ <?php $com = gmp_com("1234"); echo gmp_strval($com) . "\n"; ?> ]]> </programlisting> <para> La salida del anterior programa es: </para> <screen> <![CDATA[ -1235 ]]> </screen> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.doc.es (#1123) next »