| 1 |
diff --git a/double-conversion/double-to-string.cc b/double-conversion/double-to-string.cc |
| 2 |
--- a/double-conversion/double-to-string.cc |
| 3 |
+++ b/double-conversion/double-to-string.cc |
| 4 |
@@ -207,25 +207,21 @@ bool DoubleToStringConverter::ToShortest |
| 5 |
} |
| 6 |
return true; |
| 7 |
} |
| 8 |
|
| 9 |
|
| 10 |
bool DoubleToStringConverter::ToFixed(double value, |
| 11 |
int requested_digits, |
| 12 |
StringBuilder* result_builder) const { |
| 13 |
- DOUBLE_CONVERSION_ASSERT(kMaxFixedDigitsBeforePoint == 60); |
| 14 |
- const double kFirstNonFixed = 1e60; |
| 15 |
- |
| 16 |
if (Double(value).IsSpecial()) { |
| 17 |
return HandleSpecialValues(value, result_builder); |
| 18 |
} |
| 19 |
|
| 20 |
if (requested_digits > kMaxFixedDigitsAfterPoint) return false; |
| 21 |
- if (value >= kFirstNonFixed || value <= -kFirstNonFixed) return false; |
| 22 |
|
| 23 |
// Find a sufficiently precise decimal representation of n. |
| 24 |
int decimal_point; |
| 25 |
bool sign; |
| 26 |
// Add space for the '\0' byte. |
| 27 |
const int kDecimalRepCapacity = |
| 28 |
kMaxFixedDigitsBeforePoint + kMaxFixedDigitsAfterPoint + 1; |
| 29 |
char decimal_rep[kDecimalRepCapacity]; |
| 30 |
diff --git a/double-conversion/double-to-string.h b/double-conversion/double-to-string.h |
| 31 |
--- a/double-conversion/double-to-string.h |
| 32 |
+++ b/double-conversion/double-to-string.h |
| 33 |
@@ -33,17 +33,17 @@ |
| 34 |
|
| 35 |
namespace double_conversion { |
| 36 |
|
| 37 |
class DoubleToStringConverter { |
| 38 |
public: |
| 39 |
// When calling ToFixed with a double > 10^kMaxFixedDigitsBeforePoint |
| 40 |
// or a requested_digits parameter > kMaxFixedDigitsAfterPoint then the |
| 41 |
// function returns false. |
| 42 |
- static const int kMaxFixedDigitsBeforePoint = 60; |
| 43 |
+ static const int kMaxFixedDigitsBeforePoint = 308; |
| 44 |
static const int kMaxFixedDigitsAfterPoint = 100; |
| 45 |
|
| 46 |
// When calling ToExponential with a requested_digits |
| 47 |
// parameter > kMaxExponentialDigits then the function returns false. |
| 48 |
static const int kMaxExponentialDigits = 120; |
| 49 |
|
| 50 |
// When calling ToPrecision with a requested_digits |
| 51 |
// parameter < kMinPrecisionDigits or requested_digits > kMaxPrecisionDigits |