Files
Leonardo Lara Rodrigues 3df4553edc Updates to abandoned/outdated/missing pages in reference/math/ (#376)
* Updates to abandoned/outdated/missing pages in reference/math/

* Correction from `en` version

* Revision ready

* Updates to outdated pages in reference/dom

* Updates to reference/dbase/ pages

* Corrections to math functions pages

* Updates to abandoned/outdated pages in reference/dbase

* Correction to function name

---------

Co-authored-by: LEONARDO LARA RODRIGUES <leonardolara@github.com>
2023-12-04 12:53:37 -03:00

232 lines
6.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 0c9c2dd669fe9395eaa73d487fbd160f9057429a Maintainer: leonardolara Status: ready --><!-- CREDITS: rarruda,leonardolara -->
<refentry xml:id="function.decbin" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>decbin</refname>
<refpurpose>Decimal para binário</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>decbin</methodname>
<methodparam><type>int</type><parameter>num</parameter></methodparam>
</methodsynopsis>
<para>
Retorna uma string contendo uma representação binária do argumento
<parameter>num</parameter> informado.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>num</parameter></term>
<listitem>
<para>
Valor decimal a ser convertido
</para>
<table>
<title>Limites de entrada em máquinas de 32 bits</title>
<tgroup cols="3">
<colspec colname="c1"/>
<colspec colname="c2"/>
<colspec colname="c3"/>
<thead>
<row>
<entry><parameter>num</parameter> positivo</entry>
<entry><parameter>num</parameter> negativo</entry>
<entry>valor de retorno</entry>
</row>
</thead>
<tbody>
<row>
<entry>0</entry>
<entry/>
<entry>0</entry>
</row>
<row>
<entry>1</entry>
<entry/>
<entry>1</entry>
</row>
<row>
<entry>2</entry>
<entry/>
<entry>10</entry>
</row>
<row>
<entry namest="c1" nameend="c3">... progressão normal ...</entry>
</row>
<row>
<entry>2147483646</entry>
<entry/>
<entry>1111111111111111111111111111110</entry>
</row>
<row>
<entry>2147483647 (maior inteiro com sinal)</entry>
<entry/>
<entry>1111111111111111111111111111111 (31 números 1)</entry>
</row>
<row>
<entry>2147483648</entry>
<entry>-2147483648</entry>
<entry>10000000000000000000000000000000</entry>
</row>
<row>
<entry namest="c1" nameend="c3">... progressão normal ...</entry>
</row>
<row>
<entry>4294967294</entry>
<entry>-2</entry>
<entry>11111111111111111111111111111110</entry>
</row>
<row>
<entry>4294967295 (maior inteiro sem sinal)</entry>
<entry>-1</entry>
<entry>11111111111111111111111111111111 (32 números 1)</entry>
</row>
</tbody>
</tgroup>
</table>
<table>
<title>Limites de entrada em máquinas de 64 bits</title>
<tgroup cols="3">
<colspec colname="c1"/>
<colspec colname="c2"/>
<colspec colname="c3"/>
<thead>
<row>
<entry><parameter>num</parameter> positivo</entry>
<entry><parameter>num</parameter> negativo</entry>
<entry>valor de retorno</entry>
</row>
</thead>
<tbody>
<row>
<entry>0</entry>
<entry/>
<entry>0</entry>
</row>
<row>
<entry>1</entry>
<entry/>
<entry>1</entry>
</row>
<row>
<entry>2</entry>
<entry/>
<entry>10</entry>
</row>
<row>
<entry namest="c1" nameend="c3">... progressão normal ...</entry>
</row>
<row>
<entry>9223372036854775806</entry>
<entry/>
<entry>111111111111111111111111111111111111111111111111111111111111110</entry>
</row>
<row>
<entry>9223372036854775807 (maior inteiro com sinal)</entry>
<entry/>
<entry>111111111111111111111111111111111111111111111111111111111111111 (63 números 1)</entry>
</row>
<row>
<entry/>
<entry>-9223372036854775808</entry>
<entry>1000000000000000000000000000000000000000000000000000000000000000</entry>
</row>
<row>
<entry namest="c1" nameend="c3">... progressão normal ...</entry>
</row>
<row>
<entry/>
<entry>-2</entry>
<entry>1111111111111111111111111111111111111111111111111111111111111110</entry>
</row>
<row>
<entry/>
<entry>-1</entry>
<entry>1111111111111111111111111111111111111111111111111111111111111111 (64 números 1)</entry>
</row>
</tbody>
</tgroup>
</table>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Representação de <parameter>num</parameter> em string binária.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Exemplo de <function>decbin</function></title>
<programlisting role="php">
<![CDATA[
<?php
echo decbin(12) . "\n";
echo decbin(26);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
1100
11010
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>bindec</function></member>
<member><function>decoct</function></member>
<member><function>dechex</function></member>
<member><function>base_convert</function></member>
<member>
<function>printf</function>, usando <literal>%b</literal>,
<literal>%032b</literal> ou <literal>%064b</literal> como formato
</member>
<member>
<function>sprintf</function>, usando <literal>%b</literal>,
<literal>%032b</literal> ou <literal>%064b</literal> como formato
</member>
</simplelist>
</para>
</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:"~/.phpdoc/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
-->