iliaa Sun Aug 8 17:25:55 2004 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/standard math.c
Log:
Remove \r characters from file.
http://cvs.php.net/diff.php/php-src/ext/standard/math.c?r1=1.115&r2=1.115.2.1&ty=u
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.115 php-src/ext/standard/math.c:1.115.2.1
--- php-src/ext/standard/math.c:1.115 Thu Jun 10 15:38:24 2004
+++ php-src/ext/standard/math.c Sun Aug 8 17:25:55 2004
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: math.c,v 1.115 2004/06/10 19:38:24 iliaa Exp $ */
+/* $Id: math.c,v 1.115.2.1 2004/08/08 21:25:55 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