iliaa           Sun Aug  8 17:26:29 2004 EDT

  Modified files:              
    /php-src/ext/standard       math.c 
  Log:
  MFB: removed \r characters.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/math.c?r1=1.116&r2=1.117&ty=u
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.116 php-src/ext/standard/math.c:1.117
--- php-src/ext/standard/math.c:1.116   Mon Jul 19 03:19:44 2004
+++ php-src/ext/standard/math.c Sun Aug  8 17:26:29 2004
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: math.c,v 1.116 2004/07/19 07:19:44 andi Exp $ */
+/* $Id: math.c,v 1.117 2004/08/08 21:26:29 iliaa Exp $ */
 
 #include "php.h"
 #include "php_math.h"
@@ -448,34 +448,34 @@
        convert_scalar_to_number(zexp TSRMLS_CC);
 
        /* if both base and exponent were longs, we'll try to get a long out */
-       if (Z_TYPE_P(zbase) == IS_LONG && Z_TYPE_P(zexp) == IS_LONG && Z_LVAL_P(zexp) 
>= 0) {
-               long l1 = 1, l2 = Z_LVAL_P(zbase), i = Z_LVAL_P(zexp);
-               
-               if (i == 0) {
-                       RETURN_LONG(1L);
-               } else if (l2 == 0) {
-                       RETURN_LONG(0);
-               }
-
-               /* calculate pow(long,long) in O(log exp) operations, bail if overflow 
*/
-               while (i >= 1) {
-                       int overflow;
-                       double dval;
-
-                       if (i % 2) {
-                               --i;
-                               ZEND_SIGNED_MULTIPLY_LONG(l1,l2,l1,dval,overflow);
-                               if (overflow) RETURN_DOUBLE(dval * pow(l2,i));
-                       } else {
-                               i /= 2;
-                               ZEND_SIGNED_MULTIPLY_LONG(l2,l2,l2,dval,overflow);
-                               if (overflow) RETURN_DOUBLE((double)l1 * pow(dval,i));
-                       }
-                       if (i == 0) {
-                               RETURN_LONG(l1);
-                       }
+       if (Z_TYPE_P(zbase) == IS_LONG && Z_TYPE_P(zexp) == IS_LONG && Z_LVAL_P(zexp) 
>= 0) {
+               long l1 = 1, l2 = Z_LVAL_P(zbase), i = Z_LVAL_P(zexp);
+               
+               if (i == 0) {
+                       RETURN_LONG(1L);
+               } else if (l2 == 0) {
+                       RETURN_LONG(0);
                }
-       }
+
+               /* calculate pow(long,long) in O(log exp) operations, bail if overflow 
*/
+               while (i >= 1) {
+                       int overflow;
+                       double dval;
+
+                       if (i % 2) {
+                               --i;
+                               ZEND_SIGNED_MULTIPLY_LONG(l1,l2,l1,dval,overflow);
+                               if (overflow) RETURN_DOUBLE(dval * pow(l2,i));
+                       } else {
+                               i /= 2;
+                               ZEND_SIGNED_MULTIPLY_LONG(l2,l2,l2,dval,overflow);
+                               if (overflow) RETURN_DOUBLE((double)l1 * pow(dval,i));
+                       }
+                       if (i == 0) {
+                               RETURN_LONG(l1);
+                       }
+               }
+       }
        convert_to_double(zbase);
        convert_to_double(zexp);
        

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to