]> granicus.if.org Git - php/commitdiff
Remove old zend_string_to_double function
authorNikita Popov <nikic@php.net>
Thu, 4 Sep 2014 23:03:29 +0000 (01:03 +0200)
committerNikita Popov <nikic@php.net>
Fri, 5 Sep 2014 09:20:06 +0000 (11:20 +0200)
Zend/zend_operators.c
Zend/zend_operators.h

index 617e6bd216e436de5aba3eae922daa3538cd79b0..a4ca8713b8ea5fa0aedfdf6d6f3f10edf31db8db 100644 (file)
@@ -135,52 +135,6 @@ ZEND_API zend_long zend_atol(const char *str, int str_len) /* {{{ */
 }
 /* }}} */
 
-ZEND_API double zend_string_to_double(const char *number, uint32_t length) /* {{{ */
-{
-       double divisor = 10.0;
-       double result = 0.0;
-       double exponent;
-       const char *end = number+length;
-       const char *digit = number;
-
-       if (!length) {
-               return result;
-       }
-
-       while (digit < end) {
-               if ((*digit <= '9' && *digit >= '0')) {
-                       result *= 10;
-                       result += *digit - '0';
-               } else if (*digit == '.') {
-                       digit++;
-                       break;
-               } else if (toupper(*digit) == 'E') {
-                       exponent = (double) atoi(digit+1);
-                       result *= pow(10.0, exponent);
-                       return result;
-               } else {
-                       return result;
-               }
-               digit++;
-       }
-
-       while (digit < end) {
-               if ((*digit <= '9' && *digit >= '0')) {
-                       result += (*digit - '0') / divisor;
-                       divisor *= 10;
-               } else if (toupper(*digit) == 'E') {
-                       exponent = (double) atoi(digit+1);
-                       result *= pow(10.0, exponent);
-                       return result;
-               } else {
-                       return result;
-               }
-               digit++;
-       }
-       return result;
-}
-/* }}} */
-
 ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) /* {{{ */
 {
 try_again:
index c308777e95068c75ecc19864f69561b35d03630d..41342de0206104c50a1b58c0278ce92a9eb4eef8 100644 (file)
@@ -367,8 +367,6 @@ ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2
 #define convert_to_cstring(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_cstring((op) ZEND_FILE_LINE_CC); }
 #define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }
 
-ZEND_API double zend_string_to_double(const char *number, uint32_t length);
-
 ZEND_API int zval_is_true(zval *op);
 ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
 ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);