cvs: phpdoc /en/reference/math/functions decbin.xml
| From: | Daniel Convissor | Date: | Mon, 27 Apr 2009 01:55:51 +0000 |
| Subject: | cvs: phpdoc /en/reference/math/functions decbin.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3887@lists.php.net to get a copy of this message | ||
danielc Mon Apr 27 01:55:51 2009 UTC
Modified files:
/phpdoc/en/reference/math/functions decbin.xml
Log:
* Add table showing supported inputs and expected outputs.
* Add see also to printf() / sprintf().
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/math/functions/decbin.xml?r1=1.12&r2=1.13&diff_format=u
Index: phpdoc/en/reference/math/functions/decbin.xml
diff -u phpdoc/en/reference/math/functions/decbin.xml:1.12
phpdoc/en/reference/math/functions/decbin.xml:1.13
--- phpdoc/en/reference/math/functions/decbin.xml:1.12 Wed Jun 20 22:24:51 2007
+++ phpdoc/en/reference/math/functions/decbin.xml Mon Apr 27 01:55:51 2009
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.12 $ -->
+<!-- $Revision: 1.13 $ -->
<refentry xml:id="function.decbin" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>decbin</refname>
@@ -13,8 +13,7 @@
</methodsynopsis>
<para>
Returns a string containing a binary representation of the given
- <parameter>number</parameter> argument. The largest number that can be converted is
- 4294967295 in decimal resulting to a string of 32 1's.
+ <parameter>number</parameter> argument.
</para>
</refsect1>
<refsect1 role="parameters">
@@ -27,6 +26,135 @@
<para>
Decimal value to convert
</para>
+
+ <table>
+ <title>Range of inputs on 32-bit machines</title>
+ <tgroup cols="3">
+ <colspec colname="c1" />
+ <colspec colname="c2" />
+ <colspec colname="c3" />
+ <thead>
+ <row>
+ <entry>positive <parameter>number</parameter></entry>
+ <entry>negative <parameter>number</parameter></entry>
+ <entry>return value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry></entry>
+ <entry>0</entry>
+ </row>
+ <row>
+ <entry>1</entry>
+ <entry></entry>
+ <entry>1</entry>
+ </row>
+ <row>
+ <entry>2</entry>
+ <entry></entry>
+ <entry>10</entry>
+ </row>
+ <row>
+ <entry namest="c1" nameend="c3">... normal progression
...</entry>
+ </row>
+ <row>
+ <entry>2147483646</entry>
+ <entry></entry>
+ <entry>1111111111111111111111111111110</entry>
+ </row>
+ <row>
+ <entry>2147483647 (largest signed integer)</entry>
+ <entry></entry>
+ <entry>1111111111111111111111111111111 (31 1's)</entry>
+ </row>
+ <row>
+ <entry>2147483648</entry>
+ <entry>-2147483648</entry>
+ <entry>10000000000000000000000000000000</entry>
+ </row>
+ <row>
+ <entry namest="c1" nameend="c3">... normal progression
...</entry>
+ </row>
+ <row>
+ <entry>4294967294</entry>
+ <entry>-2</entry>
+ <entry>11111111111111111111111111111110</entry>
+ </row>
+ <row>
+ <entry>4294967295 (largest unsigned integer)</entry>
+ <entry>-1</entry>
+ <entry>11111111111111111111111111111111 (32 1's)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Range of inputs on 64-bit machines</title>
+ <tgroup cols="3">
+ <colspec colname="c1" />
+ <colspec colname="c2" />
+ <colspec colname="c3" />
+ <thead>
+ <row>
+ <entry>positive <parameter>number</parameter></entry>
+ <entry>negative <parameter>number</parameter></entry>
+ <entry>return value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry></entry>
+ <entry>0</entry>
+ </row>
+ <row>
+ <entry>1</entry>
+ <entry></entry>
+ <entry>1</entry>
+ </row>
+ <row>
+ <entry>2</entry>
+ <entry></entry>
+ <entry>10</entry>
+ </row>
+ <row>
+ <entry namest="c1" nameend="c3">... normal progression
...</entry>
+ </row>
+ <row>
+ <entry>9223372036854775806</entry>
+ <entry></entry>
+
<entry>111111111111111111111111111111111111111111111111111111111111110</entry>
+ </row>
+ <row>
+ <entry>9223372036854775807 (largest signed integer)</entry>
+ <entry></entry>
+ <entry>111111111111111111111111111111111111111111111111111111111111111 (31
1's)</entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>-9223372036854775808</entry>
+
<entry>1000000000000000000000000000000000000000000000000000000000000000</entry>
+ </row>
+ <row>
+ <entry namest="c1" nameend="c3">... normal progression
...</entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>-2</entry>
+
<entry>1111111111111111111111111111111111111111111111111111111111111110</entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>-1</entry>
+ <entry>1111111111111111111111111111111111111111111111111111111111111111 (64
1's)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
</listitem>
</varlistentry>
</variablelist>
@@ -69,6 +197,11 @@
<member><function>decoct</function></member>
<member><function>dechex</function></member>
<member><function>base_convert</function></member>
+ <member>
+ <function>printf</function> or <function>sprintf</function>
+ using <literal>%b</literal>, <literal>%032b</literal> or
+ <literal>%064b</literal> as the format
+ </member>
</simplelist>
</para>
</refsect1>