Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > 703d980c580707c382b4e43e25965bc5 > files > 11974

php-manual-pt_BR-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>GMP</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Manual do PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Referência das Funções"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="textdomain"
HREF="function.textdomain.html"><LINK
REL="NEXT"
TITLE="gmp_abs"
HREF="function.gmp-abs.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="reference"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual do PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.textdomain.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.gmp-abs.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.gmp"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>L. GMP</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN59960"
></A
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="gmp.intro"
>Introdução</A
></H1
><P
>&#13;     Estas funções permitem a você trabalhar com inteiros de tamanho arbritário
     usando a biblioteca GNU <ACRONYM
CLASS="acronym"
>MP</ACRONYM
>.
    </P
><P
>&#13;     Estas funções foram adicionadas no PHP 4.0.4.
    </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Nota: </B
>
      A maioria das funções GMP aceitam números GMP comoargumentos, definidos
      como <TT
CLASS="literal"
>resource</TT
> abaixo. Entretanto, a maioria destas
      funções também aceitam argumentos númericos e strings, dado que é possível
      converter posteriormente para um número. Também, caso houver uma
      função mais rápida que possa trabalhar com números inteiros, ela
      será usada ao invés de uma função mais lenta quando os argumentos forem inteiros.
      Isto é feito de forma transparente, em resumo, você poderá usar
      inteiros em qualquer função que espere um número GMP.
      Veja também a função <A
HREF="function.gmp-init.html"
><B
CLASS="function"
>gmp_init()</B
></A
>.
     </P
></BLOCKQUOTE
></DIV
><DIV
CLASS="warning"
><P
></P
><TABLE
CLASS="warning"
BORDER="1"
WIDTH="100%"
><TR
><TD
ALIGN="CENTER"
><B
>Atenção</B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
>&#13;      Se você quiser explicitamente especificar um número inteiro largo,
      especifique-o como uma string. Se você não fizer isto, o PHP
      irá interpretar a literal inteira primeiro, possivelmente resultando em
      perca de precisão, mesmo antes de começar a utilizar o <TT
CLASS="literal"
>GMP</TT
>.
     </P
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Nota: </B
>Esta extensão não está
 disponível na plataforma Windows.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="gmp.requirements"
>Dependências</A
></H1
><P
>&#13;     Você pode copiar a biblioteca <ACRONYM
CLASS="acronym"
>GMP</ACRONYM
> a partir de <A
HREF="http://www.swox.com/gmp/"
TARGET="_top"
>http://www.swox.com/gmp/</A
>. Este site também tem o manual
     <ACRONYM
CLASS="acronym"
>GMP</ACRONYM
> disponível.
    </P
><P
>&#13;     Você vai precisar do GMP versão 2 ou posterior para usar estas funções. Algumas
     destas funções podem querer uma versão mais recente da biblioteca GMP.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="gmp.installation"
>Instalação</A
></H1
><P
>&#13;  Para ter estas funções disponíveis, você deve compilar o PHP com suporte a
  <ACRONYM
CLASS="acronym"
>GMP</ACRONYM
> usando a opção de configuração <CODE
CLASS="option"
>--with-gmp</CODE
>.
 </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="gmp.configuration"
>Configurações em execução</A
></H1
><P
>Esta extensão não define nenhum parâmetro de configuração no <TT
CLASS="filename"
>php.ini</TT
>.</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="gmp.resources"
>Tipos Resource</A
></H1
><P
>Esta extensão não possui nenhum tipo resource.</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="gmp.constants"
>Constantes pré-definidas</A
></H1
><P
>&#13;As contantes abaixo são definidas por esta extensão e somente
 estarão disponíveis quando a extensão foi compilada com o PHP
 ou carregada dinamicamente durante a execução.
</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><TT
CLASS="constant"
><B
>GMP_ROUND_ZERO</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>GMP_ROUND_PLUSINF</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>GMP_ROUND_MINUSINF</B
></TT
> 
    (<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="gmp.examples"
>Exemplos</A
></H1
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN60019"
></A
><P
><B
>Exemplo 1. Função de fatorial usando GMP</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#007700">function </font><font color="#0000BB">fact </font><font color="#007700">(</font><font color="#0000BB">$x</font><font color="#007700">) <br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$x </font><font color="#007700">&lt;= </font><font color="#0000BB">1</font><font color="#007700">) { <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return </font><font color="#0000BB">1</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return </font><font color="#0000BB">gmp_mul </font><font color="#007700">(</font><font color="#0000BB">$x</font><font color="#007700">, </font><font color="#0000BB">fact </font><font color="#007700">(</font><font color="#0000BB">$x</font><font color="#007700">-</font><font color="#0000BB">1</font><font color="#007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br />}<br /><br />echo </font><font color="#0000BB">gmp_strval</font><font color="#007700">(</font><font color="#0000BB">fact</font><font color="#007700">(</font><font color="#0000BB">1000</font><font color="#007700">)) . </font><font color="#DD0000">"\n"</font><font color="#007700">;<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     Esta irá calcular o fatorial de 1000 (um número grande)
     muito rapidamente.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="gmp.seealso"
>Veja também</A
></H1
><P
>&#13;     Mais funções matemáticas podem ser encontradas nas seções
     <A
HREF="ref.bc.html"
>BCMath Funções Matemáticas de Precisão Arbitrária</A
>
     and <A
HREF="ref.math.html"
>Matemática e Trigonometria</A
>.
    </P
></DIV
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>Índice</B
></DT
><DT
><A
HREF="function.gmp-abs.html"
>gmp_abs</A
>&nbsp;--&nbsp;Valor absoluto</DT
><DT
><A
HREF="function.gmp-add.html"
>gmp_add</A
>&nbsp;--&nbsp;Adiciona números</DT
><DT
><A
HREF="function.gmp-and.html"
>gmp_and</A
>&nbsp;--&nbsp;Lógico AND</DT
><DT
><A
HREF="function.gmp-clrbit.html"
>gmp_clrbit</A
>&nbsp;--&nbsp;Limpa bit</DT
><DT
><A
HREF="function.gmp-cmp.html"
>gmp_cmp</A
>&nbsp;--&nbsp;Compara números</DT
><DT
><A
HREF="function.gmp-com.html"
>gmp_com</A
>&nbsp;--&nbsp;Calcula o complemento</DT
><DT
><A
HREF="function.gmp-div-q.html"
>gmp_div_q</A
>&nbsp;--&nbsp;Divide números</DT
><DT
><A
HREF="function.gmp-div-qr.html"
>gmp_div_qr</A
>&nbsp;--&nbsp;Divide números e retorna o quociente e o resto da divisão</DT
><DT
><A
HREF="function.gmp-div-r.html"
>gmp_div_r</A
>&nbsp;--&nbsp;Resto da divisão de números</DT
><DT
><A
HREF="function.gmp-div.html"
>gmp_div</A
>&nbsp;--&nbsp;Apelido para <A
HREF="function.gmp-div-q.html"
><B
CLASS="function"
>gmp_div_q()</B
></A
></DT
><DT
><A
HREF="function.gmp-divexact.html"
>gmp_divexact</A
>&nbsp;--&nbsp;Divisão exata de números</DT
><DT
><A
HREF="function.gmp-fact.html"
>gmp_fact</A
>&nbsp;--&nbsp;Fatorial</DT
><DT
><A
HREF="function.gmp-gcd.html"
>gmp_gcd</A
>&nbsp;--&nbsp;Calcula o MDC</DT
><DT
><A
HREF="function.gmp-gcdext.html"
>gmp_gcdext</A
>&nbsp;--&nbsp;Calculate GCD and multipliers</DT
><DT
><A
HREF="function.gmp-hamdist.html"
>gmp_hamdist</A
>&nbsp;--&nbsp;Hamming distance</DT
><DT
><A
HREF="function.gmp-init.html"
>gmp_init</A
>&nbsp;--&nbsp;Cria um número GMP</DT
><DT
><A
HREF="function.gmp-intval.html"
>gmp_intval</A
>&nbsp;--&nbsp;Converte um número GMP para um inteiro</DT
><DT
><A
HREF="function.gmp-invert.html"
>gmp_invert</A
>&nbsp;--&nbsp;Inverse by modulo</DT
><DT
><A
HREF="function.gmp-jacobi.html"
>gmp_jacobi</A
>&nbsp;--&nbsp;Jacobi symbol</DT
><DT
><A
HREF="function.gmp-legendre.html"
>gmp_legendre</A
>&nbsp;--&nbsp;Legendre symbol</DT
><DT
><A
HREF="function.gmp-mod.html"
>gmp_mod</A
>&nbsp;--&nbsp;Modulo operation</DT
><DT
><A
HREF="function.gmp-mul.html"
>gmp_mul</A
>&nbsp;--&nbsp;Multiplica números</DT
><DT
><A
HREF="function.gmp-neg.html"
>gmp_neg</A
>&nbsp;--&nbsp;Nega o número</DT
><DT
><A
HREF="function.gmp-nextprime.html"
>gmp_nextprime</A
>&nbsp;--&nbsp;Find next prime number</DT
><DT
><A
HREF="function.gmp-or.html"
>gmp_or</A
>&nbsp;--&nbsp;Lógico OR</DT
><DT
><A
HREF="function.gmp-perfect-square.html"
>gmp_perfect_square</A
>&nbsp;--&nbsp;Perfect square check</DT
><DT
><A
HREF="function.gmp-popcount.html"
>gmp_popcount</A
>&nbsp;--&nbsp;Contagem de população</DT
><DT
><A
HREF="function.gmp-pow.html"
>gmp_pow</A
>&nbsp;--&nbsp;Potenciação</DT
><DT
><A
HREF="function.gmp-powm.html"
>gmp_powm</A
>&nbsp;--&nbsp;Raise number into power with modulo</DT
><DT
><A
HREF="function.gmp-prob-prime.html"
>gmp_prob_prime</A
>&nbsp;--&nbsp;Check if number is "probably prime"</DT
><DT
><A
HREF="function.gmp-random.html"
>gmp_random</A
>&nbsp;--&nbsp;Número randomico</DT
><DT
><A
HREF="function.gmp-scan0.html"
>gmp_scan0</A
>&nbsp;--&nbsp;Scan for 0</DT
><DT
><A
HREF="function.gmp-scan1.html"
>gmp_scan1</A
>&nbsp;--&nbsp;Scan for 1</DT
><DT
><A
HREF="function.gmp-setbit.html"
>gmp_setbit</A
>&nbsp;--&nbsp;Set bit</DT
><DT
><A
HREF="function.gmp-sign.html"
>gmp_sign</A
>&nbsp;--&nbsp;Sinal do número</DT
><DT
><A
HREF="function.gmp-sqrt.html"
>gmp_sqrt</A
>&nbsp;--&nbsp;Raíz quadrada</DT
><DT
><A
HREF="function.gmp-sqrtrem.html"
>gmp_sqrtrem</A
>&nbsp;--&nbsp;
     Square root with remainder
    </DT
><DT
><A
HREF="function.gmp-strval.html"
>gmp_strval</A
>&nbsp;--&nbsp;Converte um número GMP para uma string</DT
><DT
><A
HREF="function.gmp-sub.html"
>gmp_sub</A
>&nbsp;--&nbsp;Subtrai números</DT
><DT
><A
HREF="function.gmp-xor.html"
>gmp_xor</A
>&nbsp;--&nbsp;Lógico XOR</DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.textdomain.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Principal</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.gmp-abs.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>textdomain</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
ACCESSKEY="U"
>Acima</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>gmp_abs</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>