DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Line Code
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 52 53 54 55 56 57 58 59 60 61 62
diff --git a/mfbt/double-conversion/double-conversion/double-conversion.cc b/mfbt/double-conversion/double-conversion/double-conversion.cc
--- a/mfbt/double-conversion/double-conversion/double-conversion.cc
+++ b/mfbt/double-conversion/double-conversion/double-conversion.cc
@@ -279,17 +279,19 @@ bool DoubleToStringConverter::ToExponent
                                   exponent,
                                   result_builder);
   return true;
 }
 
 
 bool DoubleToStringConverter::ToPrecision(double value,
                                           int precision,
+                                          bool* used_exponential_notation,
                                           StringBuilder* result_builder) const {
+  *used_exponential_notation = false;
   if (Double(value).IsSpecial()) {
     return HandleSpecialValues(value, result_builder);
   }
 
   if (precision < kMinPrecisionDigits || precision > kMaxPrecisionDigits) {
     return false;
   }
 
@@ -321,16 +323,17 @@ bool DoubleToStringConverter::ToPrecisio
        max_trailing_padding_zeroes_in_precision_mode_)) {
     // Fill buffer to contain 'precision' digits.
     // Usually the buffer is already at the correct length, but 'DoubleToAscii'
     // is allowed to return less characters.
     for (int i = decimal_rep_length; i < precision; ++i) {
       decimal_rep[i] = '0';
     }
 
+    *used_exponential_notation = true;
     CreateExponentialRepresentation(decimal_rep,
                                     precision,
                                     exponent,
                                     result_builder);
   } else {
     CreateDecimalRepresentation(decimal_rep, decimal_rep_length, decimal_point,
                                 Max(0, precision - decimal_point),
                                 result_builder);
diff --git a/mfbt/double-conversion/double-conversion/double-conversion.h b/mfbt/double-conversion/double-conversion/double-conversion.h
--- a/mfbt/double-conversion/double-conversion/double-conversion.h
+++ b/mfbt/double-conversion/double-conversion/double-conversion.h
@@ -265,16 +265,17 @@ class DoubleToStringConverter {
   //     been provided to the constructor,
   //   - precision < kMinPericisionDigits
   //   - precision > kMaxPrecisionDigits
   // The last condition implies that the result will never contain more than
   // kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the
   // exponent character, the exponent's sign, and at most 3 exponent digits).
   MFBT_API bool ToPrecision(double value,
                    int precision,
+                   bool* used_exponential_notation,
                    StringBuilder* result_builder) const;
 
   enum DtoaMode {
     // Produce the shortest correct representation.
     // For example the output of 0.299999999999999988897 is (the less accurate
     // but correct) 0.3.
     SHORTEST,
     // Same as SHORTEST, but for single-precision floats.