fix what I broke with the double diff
I committed the wrong version.
Esse commit está contido em:
@@ -824,7 +824,7 @@ int64_t StringData::toInt64(int base /* = 10 */) const {
|
||||
|
||||
double StringData::toDouble() const {
|
||||
StringSlice s = slice();
|
||||
if (s.len) return folly::to<double>(s.ptr);
|
||||
if (s.len) return strtod(s.ptr, nullptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ static double collator_u_strtod(const UChar *nptr, UChar **endptr) {
|
||||
}
|
||||
|
||||
*bufpos = '\0';
|
||||
value = folly::to<double>(numbuf);
|
||||
value = strtod(numbuf, nullptr);
|
||||
|
||||
if (numbuf != buf) {
|
||||
free(numbuf);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "hphp/runtime/base/zend/zend_functions.h"
|
||||
#include "hphp/runtime/base/zend/zend_strtod.h"
|
||||
#include "folly/Conv.h"
|
||||
|
||||
namespace HPHP {
|
||||
|
||||
@@ -184,7 +183,7 @@ DataType is_numeric_string(const char *str, int length, int64_t *lval,
|
||||
int cmp = strcmp(&ptr[-digits], long_min_digits);
|
||||
if (!(cmp < 0 || (cmp == 0 && *str == '-'))) {
|
||||
if (dval) {
|
||||
*dval = folly::to<double>(str);
|
||||
*dval = strtod(str, nullptr);
|
||||
}
|
||||
return KindOfDouble;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#define incl_HPHP_ZEND_MATH_H_
|
||||
|
||||
#include "hphp/util/base.h"
|
||||
#include "folly/Conv.h"
|
||||
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -116,7 +115,7 @@ inline double php_math_round(double value, int places,
|
||||
char buf[40];
|
||||
snprintf(buf, 39, "%15fe%d", tmp_value, -places);
|
||||
buf[39] = '\0';
|
||||
tmp_value = folly::to<double>(buf);
|
||||
tmp_value = strtod(buf, nullptr);
|
||||
|
||||
/* couldn't convert to string and back */
|
||||
if (std::isinf(tmp_value)) {
|
||||
|
||||
@@ -1045,7 +1045,7 @@ int string_sscanf(const char *string, const char *format, int numVars,
|
||||
if (!(flags & SCAN_SUPPRESS)) {
|
||||
double dvalue;
|
||||
*end = '\0';
|
||||
dvalue = folly::to<double>(buf);
|
||||
dvalue = strtod(buf, nullptr);
|
||||
return_value.append(dvalue);
|
||||
}
|
||||
break;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário