locale-independent.
EG(scope) = NULL;
EG(This) = NULL;
-
- EG(float_separator)[0] = '.';
}
void shutdown_executor(TSRMLS_D)
zend_property_info std_property_info;
- /* locale stuff */
- char float_separator[1];
-
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
};
#include "zend_ini.h"
#include "zend_alloc.h"
#include "zend_operators.h"
+#include "zend_strtod.h"
static HashTable *registered_zend_ini_directives;
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) {
if (orig && ini_entry->modified) {
- return (double) (ini_entry->orig_value ? strtod(ini_entry->orig_value, NULL) : 0.0);
+ return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0);
} else if (ini_entry->value) {
- return (double) strtod(ini_entry->value, NULL);
+ return (double) zend_strtod(ini_entry->value, NULL);
}
}
p = (double *) (base+(size_t) mh_arg1);
- *p = strtod(new_value, NULL);
+ *p = zend_strtod(new_value, NULL);
return SUCCESS;
}
#include "zend_constants.h"
#include "zend_variables.h"
#include "zend_operators.h"
+#include "zend_strtod.h"
#ifdef HAVE_STDARG_H
# include <stdarg.h>
errno = 0;
zendlval->value.lval = strtol(yytext, NULL, 0);
if (errno == ERANGE) { /* overflow */
- zendlval->value.dval = strtod(yytext, NULL);
+ zendlval->value.dval = zend_strtod(yytext, NULL);
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
} else {
}
<ST_IN_SCRIPTING>{DNUM}|{EXPONENT_DNUM} {
- zendlval->value.dval = strtod(yytext, NULL);
+ zendlval->value.dval = zend_strtod(yytext, NULL);
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
}
#include "zend_fast_cache.h"
#include "zend_API.h"
#include "zend_multiply.h"
+#include "zend_strtod.h"
#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1))
case IS_STRING:
strval = op->value.str.val;
- op->value.dval = strtod(strval, NULL);
+ op->value.dval = zend_strtod(strval, NULL);
STR_FREE(strval);
break;
case IS_ARRAY:
(ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2, 0))) {
if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) {
if (ret1!=IS_DOUBLE) {
- dval1 = strtod(s1->value.str.val, NULL);
+ dval1 = zend_strtod(s1->value.str.val, NULL);
} else if (ret2!=IS_DOUBLE) {
- dval2 = strtod(s2->value.str.val, NULL);
+ dval2 = zend_strtod(s2->value.str.val, NULL);
}
result->value.dval = dval1 - dval2;
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval);
op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
sprintf(op->value.str.val, "%.*G", (int) EG(precision), dval);
op->value.str.len = strlen(op->value.str.val);
-
- if (EG(float_separator)[0] != '.') {
- char *p = op->value.str.val;
- if ((p = strchr(p, '.'))) {
- *p = EG(float_separator)[0];
- }
- }
}
/*
#include <ieeefp.h>
#endif
+#include "zend_strtod.h"
#if 0&&HAVE_BCMATH
#include "ext/bcmath/libbcmath/src/bcmath.h"
}
errno=0;
- local_dval = strtod(str, &end_ptr_double);
+ local_dval = zend_strtod(str, &end_ptr_double);
if (errno != ERANGE) {
if (end_ptr_double == str+length) { /* floating point string */
if (!zend_finite(local_dval)) {