Index: src/strtod.cc |
diff --git a/src/strtod.cc b/src/strtod.cc |
index 2b48af3cc60c93aeaadc9660d2e5e77c99268896..4f06b3979d976b914bf1b3bda59e5cb100a8c801 100644 |
--- a/src/strtod.cc |
+++ b/src/strtod.cc |
@@ -2,8 +2,9 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include <stdarg.h> |
#include <cmath> |
+#include <cstdarg> |
+#include <limits> |
#include "src/v8.h" |
@@ -352,7 +353,7 @@ static bool DiyFpStrtod(Vector<const char> buffer, |
static double BignumStrtod(Vector<const char> buffer, |
int exponent, |
double guess) { |
- if (guess == V8_INFINITY) { |
+ if (guess == std::numeric_limits<double>::infinity()) { |
return guess; |
} |
@@ -408,7 +409,9 @@ double Strtod(Vector<const char> buffer, int exponent) { |
kMaxSignificantDecimalDigits), |
significant_exponent); |
} |
- if (exponent + trimmed.length() - 1 >= kMaxDecimalPower) return V8_INFINITY; |
+ if (exponent + trimmed.length() - 1 >= kMaxDecimalPower) { |
+ return std::numeric_limits<double>::infinity(); |
+ } |
if (exponent + trimmed.length() <= kMinDecimalPower) return 0.0; |
double guess; |