jeroen Sat Aug 4 09:08:04 2001 EDT
Modified files:
/phpdoc/en/functions math.xml
Log:
New pow() documentation to reflect 407-changes
Index: phpdoc/en/functions/math.xml
diff -u phpdoc/en/functions/math.xml:1.39 phpdoc/en/functions/math.xml:1.40
--- phpdoc/en/functions/math.xml:1.39 Thu Aug 2 13:37:02 2001
+++ phpdoc/en/functions/math.xml Sat Aug 4 09:08:04 2001
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.39 $ -->
+<!-- $Revision: 1.40 $ -->
<reference id="ref.math">
<title>Mathematical Functions</title>
<titleabbrev>Math</titleabbrev>
@@ -974,16 +974,42 @@
<title>Description</title>
<funcsynopsis>
<funcprototype>
- <funcdef>float <function>pow</function></funcdef>
- <paramdef>float <parameter>base</parameter></paramdef>
- <paramdef>float <parameter>exp</parameter></paramdef>
+ <funcdef>number <function>pow</function></funcdef>
+ <paramdef>number <parameter>base</parameter></paramdef>
+ <paramdef>number <parameter>exp</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Returns <parameter>base</parameter> raised to the power of
- <parameter>exp</parameter>. If this can't be computed,
- <function>exp</function> will return <literal>NAN</literal>.
+ <parameter>exp</parameter>. If possible, this function will
+ return an <type>integer</type>.
</para>
+ <para>
+ If the power cannot be computed, a warning will be issued,
+ and <function>pow</function> will return &false;.
+ </para>
+ <example>
+ <title>Some examples of <function>pow</function></title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+var_dump( pow(2,8) ); // int(256)
+echo pow(-1,20); // 1
+echo pow(0, 0); // 1
+
+echo pow(-1, 5.5); // error
+
+?>
+]]>
+ </programlisting>
+ </example>
+ <warning>
+ <para>
+ In PHP 4.0.6 and earlier <function>pow</function> always returned
+ a <type>float</type>, and did not issue warnings.
+ </para>
+ </warning>
<para>
See also <function>exp</function>.
</para>
@@ -1219,4 +1245,5 @@
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
+vim: ts=4 sw=4 et syntax=sgml
-->