dams            Tue Aug  7 05:04:02 2001 EDT

  Modified files:              
    /phpdoc/fr/functions        math.xml 
  Log:
  Adding new def for pow()mt_rand was already OK.
  
Index: phpdoc/fr/functions/math.xml
diff -u phpdoc/fr/functions/math.xml:1.12 phpdoc/fr/functions/math.xml:1.13
--- phpdoc/fr/functions/math.xml:1.12   Wed Jul 25 16:26:56 2001
+++ phpdoc/fr/functions/math.xml        Tue Aug  7 05:04:02 2001
@@ -1,3 +1,4 @@
+<!-- $Revision: 1.13 $ -->
 <reference id="ref.math">
  <title>Math&eacute;matiques</title>
  <titleabbrev>Maths</titleabbrev>
@@ -1001,16 +1002,45 @@
    <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>
     <function>pow</function> retourne <parameter>base</parameter>
     &eacute;lev&eacute; &agrave; la puissance <parameter>exp</parameter>.
-    Si le calcul est impossible (racine d'un nombre n&eacute;gatif, par
-    exemple), <function>exp</function> retourne <literal>NAN</literal>.
+    Si possible, <function>pow</function> retourne un <type>integer</type>.
+   </para>
+   <para>
+    <para>
+     Si le calcul ne peut tre fait, une alerte sera affichŽe et 
+      <function>pow</function> retournera &false;.
+    </para>
+    <example>
+     <title>Quelques exemples avec <function>pow</function></title>
+     <programlisting role="php">
+&lt;?php
+  var_dump( pow(2,8) ); 
+// int(256)
+  echo pow(-1,20); 
+// 1
+  echo pow(0, 0); 
+// 1
+echo pow(-1, 5.5); 
+  // erreur
+?&gt;
+     </programlisting>
+    </example>
+    <warning>
+     <para>
+      En PHP 4.0.6 plus ancien, <function>pow</function> retournait
+      toujours un nombre ˆ virgule flottante (<type>float</type>), 
+      et n'affichait pas d'alerte. Si le calcul est impossible 
+      (racine d'un nombre n&eacute;gatif, par exemple), 
+      <function>pow</function> retournait <literal>NAN</literal>.
+     </para>
+    </warning>
    </para>
    <para>
     Voir aussi


Reply via email to