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