jeroen Sat Sep 8 14:30:23 2001 EDT
Modified files:
/phpdoc/en/language types.xml
Log:
Moved warning about integer division, and added example
Index: phpdoc/en/language/types.xml
diff -u phpdoc/en/language/types.xml:1.49 phpdoc/en/language/types.xml:1.50
--- phpdoc/en/language/types.xml:1.49 Sat Sep 8 14:26:01 2001
+++ phpdoc/en/language/types.xml Sat Sep 8 14:30:23 2001
@@ -1,5 +1,5 @@
<?xml encoding="iso-8859-1"?>
-<!-- $Revision: 1.49 $ -->
+<!-- $Revision: 1.50 $ -->
<chapter id="language.types">
<title>Types</title>
@@ -293,13 +293,6 @@
(that's 32 bits signed). PHP does not support unsigned
integers.
</para>
- <note><!-- or warning? -->
- <simpara>
- In PHP there is no such thing as integer division. <literal>1/2</literal>
- yields the <type>float</type> <literal>0.5</literal>. <!-- See
- ??? for more information. (with the operators, or with type-jug) -->
- </simpara>
- </note>
</sect2>
<sect2 id="language.types.integer.overflow">
@@ -307,6 +300,12 @@
<para>
If you specify a number beyond the bounds of the <type>integer</type>-type,
it will be interpreted as a <type>float</type> instead.
+ </para>
+ <para>
+ In PHP there is also no such thing as integer division.
+ <literal>1/2</literal> yields the <type>float</type>
+ <literal>0.5</literal>. <!-- See ??? for more information. (with the
+ operators, or with type-jug) -->
<informalexample>
<programlisting role="php">
$large_number = 2147483647;
@@ -320,6 +319,9 @@
var_dump( 0x80000000 );
// output: float(2147483648)
+
+var_dump( 25/7 );
+// output: float(3.5714285714286)
</programlisting>
</informalexample>
Furthermore, if some function or operator yields a number that is beyond