1*9356374aSAndroid Build Coastguard Worker // Copyright 2018 The Abseil Authors.
2*9356374aSAndroid Build Coastguard Worker //
3*9356374aSAndroid Build Coastguard Worker // Licensed under the Apache License, Version 2.0 (the "License");
4*9356374aSAndroid Build Coastguard Worker // you may not use this file except in compliance with the License.
5*9356374aSAndroid Build Coastguard Worker // You may obtain a copy of the License at
6*9356374aSAndroid Build Coastguard Worker //
7*9356374aSAndroid Build Coastguard Worker // https://www.apache.org/licenses/LICENSE-2.0
8*9356374aSAndroid Build Coastguard Worker //
9*9356374aSAndroid Build Coastguard Worker // Unless required by applicable law or agreed to in writing, software
10*9356374aSAndroid Build Coastguard Worker // distributed under the License is distributed on an "AS IS" BASIS,
11*9356374aSAndroid Build Coastguard Worker // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*9356374aSAndroid Build Coastguard Worker // See the License for the specific language governing permissions and
13*9356374aSAndroid Build Coastguard Worker // limitations under the License.
14*9356374aSAndroid Build Coastguard Worker
15*9356374aSAndroid Build Coastguard Worker #include "absl/strings/charconv.h"
16*9356374aSAndroid Build Coastguard Worker
17*9356374aSAndroid Build Coastguard Worker #include <algorithm>
18*9356374aSAndroid Build Coastguard Worker #include <cassert>
19*9356374aSAndroid Build Coastguard Worker #include <cstddef>
20*9356374aSAndroid Build Coastguard Worker #include <cstdint>
21*9356374aSAndroid Build Coastguard Worker #include <limits>
22*9356374aSAndroid Build Coastguard Worker #include <system_error> // NOLINT(build/c++11)
23*9356374aSAndroid Build Coastguard Worker
24*9356374aSAndroid Build Coastguard Worker #include "absl/base/casts.h"
25*9356374aSAndroid Build Coastguard Worker #include "absl/base/config.h"
26*9356374aSAndroid Build Coastguard Worker #include "absl/base/nullability.h"
27*9356374aSAndroid Build Coastguard Worker #include "absl/numeric/bits.h"
28*9356374aSAndroid Build Coastguard Worker #include "absl/numeric/int128.h"
29*9356374aSAndroid Build Coastguard Worker #include "absl/strings/internal/charconv_bigint.h"
30*9356374aSAndroid Build Coastguard Worker #include "absl/strings/internal/charconv_parse.h"
31*9356374aSAndroid Build Coastguard Worker
32*9356374aSAndroid Build Coastguard Worker // The macro ABSL_BIT_PACK_FLOATS is defined on x86-64, where IEEE floating
33*9356374aSAndroid Build Coastguard Worker // point numbers have the same endianness in memory as a bitfield struct
34*9356374aSAndroid Build Coastguard Worker // containing the corresponding parts.
35*9356374aSAndroid Build Coastguard Worker //
36*9356374aSAndroid Build Coastguard Worker // When set, we replace calls to ldexp() with manual bit packing, which is
37*9356374aSAndroid Build Coastguard Worker // faster and is unaffected by floating point environment.
38*9356374aSAndroid Build Coastguard Worker #ifdef ABSL_BIT_PACK_FLOATS
39*9356374aSAndroid Build Coastguard Worker #error ABSL_BIT_PACK_FLOATS cannot be directly set
40*9356374aSAndroid Build Coastguard Worker #elif defined(__x86_64__) || defined(_M_X64)
41*9356374aSAndroid Build Coastguard Worker #define ABSL_BIT_PACK_FLOATS 1
42*9356374aSAndroid Build Coastguard Worker #endif
43*9356374aSAndroid Build Coastguard Worker
44*9356374aSAndroid Build Coastguard Worker // A note about subnormals:
45*9356374aSAndroid Build Coastguard Worker //
46*9356374aSAndroid Build Coastguard Worker // The code below talks about "normals" and "subnormals". A normal IEEE float
47*9356374aSAndroid Build Coastguard Worker // has a fixed-width mantissa and power of two exponent. For example, a normal
48*9356374aSAndroid Build Coastguard Worker // `double` has a 53-bit mantissa. Because the high bit is always 1, it is not
49*9356374aSAndroid Build Coastguard Worker // stored in the representation. The implicit bit buys an extra bit of
50*9356374aSAndroid Build Coastguard Worker // resolution in the datatype.
51*9356374aSAndroid Build Coastguard Worker //
52*9356374aSAndroid Build Coastguard Worker // The downside of this scheme is that there is a large gap between DBL_MIN and
53*9356374aSAndroid Build Coastguard Worker // zero. (Large, at least, relative to the different between DBL_MIN and the
54*9356374aSAndroid Build Coastguard Worker // next representable number). This gap is softened by the "subnormal" numbers,
55*9356374aSAndroid Build Coastguard Worker // which have the same power-of-two exponent as DBL_MIN, but no implicit 53rd
56*9356374aSAndroid Build Coastguard Worker // bit. An all-bits-zero exponent in the encoding represents subnormals. (Zero
57*9356374aSAndroid Build Coastguard Worker // is represented as a subnormal with an all-bits-zero mantissa.)
58*9356374aSAndroid Build Coastguard Worker //
59*9356374aSAndroid Build Coastguard Worker // The code below, in calculations, represents the mantissa as a uint64_t. The
60*9356374aSAndroid Build Coastguard Worker // end result normally has the 53rd bit set. It represents subnormals by using
61*9356374aSAndroid Build Coastguard Worker // narrower mantissas.
62*9356374aSAndroid Build Coastguard Worker
63*9356374aSAndroid Build Coastguard Worker namespace absl {
64*9356374aSAndroid Build Coastguard Worker ABSL_NAMESPACE_BEGIN
65*9356374aSAndroid Build Coastguard Worker namespace {
66*9356374aSAndroid Build Coastguard Worker
67*9356374aSAndroid Build Coastguard Worker template <typename FloatType>
68*9356374aSAndroid Build Coastguard Worker struct FloatTraits;
69*9356374aSAndroid Build Coastguard Worker
70*9356374aSAndroid Build Coastguard Worker template <>
71*9356374aSAndroid Build Coastguard Worker struct FloatTraits<double> {
72*9356374aSAndroid Build Coastguard Worker using mantissa_t = uint64_t;
73*9356374aSAndroid Build Coastguard Worker
74*9356374aSAndroid Build Coastguard Worker // The number of bits in the given float type.
75*9356374aSAndroid Build Coastguard Worker static constexpr int kTargetBits = 64;
76*9356374aSAndroid Build Coastguard Worker
77*9356374aSAndroid Build Coastguard Worker // The number of exponent bits in the given float type.
78*9356374aSAndroid Build Coastguard Worker static constexpr int kTargetExponentBits = 11;
79*9356374aSAndroid Build Coastguard Worker
80*9356374aSAndroid Build Coastguard Worker // The number of mantissa bits in the given float type. This includes the
81*9356374aSAndroid Build Coastguard Worker // implied high bit.
82*9356374aSAndroid Build Coastguard Worker static constexpr int kTargetMantissaBits = 53;
83*9356374aSAndroid Build Coastguard Worker
84*9356374aSAndroid Build Coastguard Worker // The largest supported IEEE exponent, in our integral mantissa
85*9356374aSAndroid Build Coastguard Worker // representation.
86*9356374aSAndroid Build Coastguard Worker //
87*9356374aSAndroid Build Coastguard Worker // If `m` is the largest possible int kTargetMantissaBits bits wide, then
88*9356374aSAndroid Build Coastguard Worker // m * 2**kMaxExponent is exactly equal to DBL_MAX.
89*9356374aSAndroid Build Coastguard Worker static constexpr int kMaxExponent = 971;
90*9356374aSAndroid Build Coastguard Worker
91*9356374aSAndroid Build Coastguard Worker // The smallest supported IEEE normal exponent, in our integral mantissa
92*9356374aSAndroid Build Coastguard Worker // representation.
93*9356374aSAndroid Build Coastguard Worker //
94*9356374aSAndroid Build Coastguard Worker // If `m` is the smallest possible int kTargetMantissaBits bits wide, then
95*9356374aSAndroid Build Coastguard Worker // m * 2**kMinNormalExponent is exactly equal to DBL_MIN.
96*9356374aSAndroid Build Coastguard Worker static constexpr int kMinNormalExponent = -1074;
97*9356374aSAndroid Build Coastguard Worker
98*9356374aSAndroid Build Coastguard Worker // The IEEE exponent bias. It equals ((1 << (kTargetExponentBits - 1)) - 1).
99*9356374aSAndroid Build Coastguard Worker static constexpr int kExponentBias = 1023;
100*9356374aSAndroid Build Coastguard Worker
101*9356374aSAndroid Build Coastguard Worker // The Eisel-Lemire "Shifting to 54/25 Bits" adjustment. It equals (63 - 1 -
102*9356374aSAndroid Build Coastguard Worker // kTargetMantissaBits).
103*9356374aSAndroid Build Coastguard Worker static constexpr int kEiselLemireShift = 9;
104*9356374aSAndroid Build Coastguard Worker
105*9356374aSAndroid Build Coastguard Worker // The Eisel-Lemire high64_mask. It equals ((1 << kEiselLemireShift) - 1).
106*9356374aSAndroid Build Coastguard Worker static constexpr uint64_t kEiselLemireMask = uint64_t{0x1FF};
107*9356374aSAndroid Build Coastguard Worker
108*9356374aSAndroid Build Coastguard Worker // The smallest negative integer N (smallest negative means furthest from
109*9356374aSAndroid Build Coastguard Worker // zero) such that parsing 9999999999999999999eN, with 19 nines, is still
110*9356374aSAndroid Build Coastguard Worker // positive. Parsing a smaller (more negative) N will produce zero.
111*9356374aSAndroid Build Coastguard Worker //
112*9356374aSAndroid Build Coastguard Worker // Adjusting the decimal point and exponent, without adjusting the value,
113*9356374aSAndroid Build Coastguard Worker // 9999999999999999999eN equals 9.999999999999999999eM where M = N + 18.
114*9356374aSAndroid Build Coastguard Worker //
115*9356374aSAndroid Build Coastguard Worker // 9999999999999999999, with 19 nines but no decimal point, is the largest
116*9356374aSAndroid Build Coastguard Worker // "repeated nines" integer that fits in a uint64_t.
117*9356374aSAndroid Build Coastguard Worker static constexpr int kEiselLemireMinInclusiveExp10 = -324 - 18;
118*9356374aSAndroid Build Coastguard Worker
119*9356374aSAndroid Build Coastguard Worker // The smallest positive integer N such that parsing 1eN produces infinity.
120*9356374aSAndroid Build Coastguard Worker // Parsing a smaller N will produce something finite.
121*9356374aSAndroid Build Coastguard Worker static constexpr int kEiselLemireMaxExclusiveExp10 = 309;
122*9356374aSAndroid Build Coastguard Worker
MakeNanabsl::__anone834fbc80111::FloatTraits123*9356374aSAndroid Build Coastguard Worker static double MakeNan(absl::Nonnull<const char*> tagp) {
124*9356374aSAndroid Build Coastguard Worker #if ABSL_HAVE_BUILTIN(__builtin_nan)
125*9356374aSAndroid Build Coastguard Worker // Use __builtin_nan() if available since it has a fix for
126*9356374aSAndroid Build Coastguard Worker // https://bugs.llvm.org/show_bug.cgi?id=37778
127*9356374aSAndroid Build Coastguard Worker // std::nan may use the glibc implementation.
128*9356374aSAndroid Build Coastguard Worker return __builtin_nan(tagp);
129*9356374aSAndroid Build Coastguard Worker #else
130*9356374aSAndroid Build Coastguard Worker // Support nan no matter which namespace it's in. Some platforms
131*9356374aSAndroid Build Coastguard Worker // incorrectly don't put it in namespace std.
132*9356374aSAndroid Build Coastguard Worker using namespace std; // NOLINT
133*9356374aSAndroid Build Coastguard Worker return nan(tagp);
134*9356374aSAndroid Build Coastguard Worker #endif
135*9356374aSAndroid Build Coastguard Worker }
136*9356374aSAndroid Build Coastguard Worker
137*9356374aSAndroid Build Coastguard Worker // Builds a nonzero floating point number out of the provided parts.
138*9356374aSAndroid Build Coastguard Worker //
139*9356374aSAndroid Build Coastguard Worker // This is intended to do the same operation as ldexp(mantissa, exponent),
140*9356374aSAndroid Build Coastguard Worker // but using purely integer math, to avoid -ffastmath and floating
141*9356374aSAndroid Build Coastguard Worker // point environment issues. Using type punning is also faster. We fall back
142*9356374aSAndroid Build Coastguard Worker // to ldexp on a per-platform basis for portability.
143*9356374aSAndroid Build Coastguard Worker //
144*9356374aSAndroid Build Coastguard Worker // `exponent` must be between kMinNormalExponent and kMaxExponent.
145*9356374aSAndroid Build Coastguard Worker //
146*9356374aSAndroid Build Coastguard Worker // `mantissa` must either be exactly kTargetMantissaBits wide, in which case
147*9356374aSAndroid Build Coastguard Worker // a normal value is made, or it must be less narrow than that, in which case
148*9356374aSAndroid Build Coastguard Worker // `exponent` must be exactly kMinNormalExponent, and a subnormal value is
149*9356374aSAndroid Build Coastguard Worker // made.
Makeabsl::__anone834fbc80111::FloatTraits150*9356374aSAndroid Build Coastguard Worker static double Make(mantissa_t mantissa, int exponent, bool sign) {
151*9356374aSAndroid Build Coastguard Worker #ifndef ABSL_BIT_PACK_FLOATS
152*9356374aSAndroid Build Coastguard Worker // Support ldexp no matter which namespace it's in. Some platforms
153*9356374aSAndroid Build Coastguard Worker // incorrectly don't put it in namespace std.
154*9356374aSAndroid Build Coastguard Worker using namespace std; // NOLINT
155*9356374aSAndroid Build Coastguard Worker return sign ? -ldexp(mantissa, exponent) : ldexp(mantissa, exponent);
156*9356374aSAndroid Build Coastguard Worker #else
157*9356374aSAndroid Build Coastguard Worker constexpr uint64_t kMantissaMask =
158*9356374aSAndroid Build Coastguard Worker (uint64_t{1} << (kTargetMantissaBits - 1)) - 1;
159*9356374aSAndroid Build Coastguard Worker uint64_t dbl = static_cast<uint64_t>(sign) << 63;
160*9356374aSAndroid Build Coastguard Worker if (mantissa > kMantissaMask) {
161*9356374aSAndroid Build Coastguard Worker // Normal value.
162*9356374aSAndroid Build Coastguard Worker // Adjust by 1023 for the exponent representation bias, and an additional
163*9356374aSAndroid Build Coastguard Worker // 52 due to the implied decimal point in the IEEE mantissa
164*9356374aSAndroid Build Coastguard Worker // representation.
165*9356374aSAndroid Build Coastguard Worker dbl += static_cast<uint64_t>(exponent + 1023 + kTargetMantissaBits - 1)
166*9356374aSAndroid Build Coastguard Worker << 52;
167*9356374aSAndroid Build Coastguard Worker mantissa &= kMantissaMask;
168*9356374aSAndroid Build Coastguard Worker } else {
169*9356374aSAndroid Build Coastguard Worker // subnormal value
170*9356374aSAndroid Build Coastguard Worker assert(exponent == kMinNormalExponent);
171*9356374aSAndroid Build Coastguard Worker }
172*9356374aSAndroid Build Coastguard Worker dbl += mantissa;
173*9356374aSAndroid Build Coastguard Worker return absl::bit_cast<double>(dbl);
174*9356374aSAndroid Build Coastguard Worker #endif // ABSL_BIT_PACK_FLOATS
175*9356374aSAndroid Build Coastguard Worker }
176*9356374aSAndroid Build Coastguard Worker };
177*9356374aSAndroid Build Coastguard Worker
178*9356374aSAndroid Build Coastguard Worker // Specialization of floating point traits for the `float` type. See the
179*9356374aSAndroid Build Coastguard Worker // FloatTraits<double> specialization above for meaning of each of the following
180*9356374aSAndroid Build Coastguard Worker // members and methods.
181*9356374aSAndroid Build Coastguard Worker template <>
182*9356374aSAndroid Build Coastguard Worker struct FloatTraits<float> {
183*9356374aSAndroid Build Coastguard Worker using mantissa_t = uint32_t;
184*9356374aSAndroid Build Coastguard Worker
185*9356374aSAndroid Build Coastguard Worker static constexpr int kTargetBits = 32;
186*9356374aSAndroid Build Coastguard Worker static constexpr int kTargetExponentBits = 8;
187*9356374aSAndroid Build Coastguard Worker static constexpr int kTargetMantissaBits = 24;
188*9356374aSAndroid Build Coastguard Worker static constexpr int kMaxExponent = 104;
189*9356374aSAndroid Build Coastguard Worker static constexpr int kMinNormalExponent = -149;
190*9356374aSAndroid Build Coastguard Worker static constexpr int kExponentBias = 127;
191*9356374aSAndroid Build Coastguard Worker static constexpr int kEiselLemireShift = 38;
192*9356374aSAndroid Build Coastguard Worker static constexpr uint64_t kEiselLemireMask = uint64_t{0x3FFFFFFFFF};
193*9356374aSAndroid Build Coastguard Worker static constexpr int kEiselLemireMinInclusiveExp10 = -46 - 18;
194*9356374aSAndroid Build Coastguard Worker static constexpr int kEiselLemireMaxExclusiveExp10 = 39;
195*9356374aSAndroid Build Coastguard Worker
MakeNanabsl::__anone834fbc80111::FloatTraits196*9356374aSAndroid Build Coastguard Worker static float MakeNan(absl::Nonnull<const char*> tagp) {
197*9356374aSAndroid Build Coastguard Worker #if ABSL_HAVE_BUILTIN(__builtin_nanf)
198*9356374aSAndroid Build Coastguard Worker // Use __builtin_nanf() if available since it has a fix for
199*9356374aSAndroid Build Coastguard Worker // https://bugs.llvm.org/show_bug.cgi?id=37778
200*9356374aSAndroid Build Coastguard Worker // std::nanf may use the glibc implementation.
201*9356374aSAndroid Build Coastguard Worker return __builtin_nanf(tagp);
202*9356374aSAndroid Build Coastguard Worker #else
203*9356374aSAndroid Build Coastguard Worker // Support nanf no matter which namespace it's in. Some platforms
204*9356374aSAndroid Build Coastguard Worker // incorrectly don't put it in namespace std.
205*9356374aSAndroid Build Coastguard Worker using namespace std; // NOLINT
206*9356374aSAndroid Build Coastguard Worker return std::nanf(tagp);
207*9356374aSAndroid Build Coastguard Worker #endif
208*9356374aSAndroid Build Coastguard Worker }
209*9356374aSAndroid Build Coastguard Worker
Makeabsl::__anone834fbc80111::FloatTraits210*9356374aSAndroid Build Coastguard Worker static float Make(mantissa_t mantissa, int exponent, bool sign) {
211*9356374aSAndroid Build Coastguard Worker #ifndef ABSL_BIT_PACK_FLOATS
212*9356374aSAndroid Build Coastguard Worker // Support ldexpf no matter which namespace it's in. Some platforms
213*9356374aSAndroid Build Coastguard Worker // incorrectly don't put it in namespace std.
214*9356374aSAndroid Build Coastguard Worker using namespace std; // NOLINT
215*9356374aSAndroid Build Coastguard Worker return sign ? -ldexpf(mantissa, exponent) : ldexpf(mantissa, exponent);
216*9356374aSAndroid Build Coastguard Worker #else
217*9356374aSAndroid Build Coastguard Worker constexpr uint32_t kMantissaMask =
218*9356374aSAndroid Build Coastguard Worker (uint32_t{1} << (kTargetMantissaBits - 1)) - 1;
219*9356374aSAndroid Build Coastguard Worker uint32_t flt = static_cast<uint32_t>(sign) << 31;
220*9356374aSAndroid Build Coastguard Worker if (mantissa > kMantissaMask) {
221*9356374aSAndroid Build Coastguard Worker // Normal value.
222*9356374aSAndroid Build Coastguard Worker // Adjust by 127 for the exponent representation bias, and an additional
223*9356374aSAndroid Build Coastguard Worker // 23 due to the implied decimal point in the IEEE mantissa
224*9356374aSAndroid Build Coastguard Worker // representation.
225*9356374aSAndroid Build Coastguard Worker flt += static_cast<uint32_t>(exponent + 127 + kTargetMantissaBits - 1)
226*9356374aSAndroid Build Coastguard Worker << 23;
227*9356374aSAndroid Build Coastguard Worker mantissa &= kMantissaMask;
228*9356374aSAndroid Build Coastguard Worker } else {
229*9356374aSAndroid Build Coastguard Worker // subnormal value
230*9356374aSAndroid Build Coastguard Worker assert(exponent == kMinNormalExponent);
231*9356374aSAndroid Build Coastguard Worker }
232*9356374aSAndroid Build Coastguard Worker flt += mantissa;
233*9356374aSAndroid Build Coastguard Worker return absl::bit_cast<float>(flt);
234*9356374aSAndroid Build Coastguard Worker #endif // ABSL_BIT_PACK_FLOATS
235*9356374aSAndroid Build Coastguard Worker }
236*9356374aSAndroid Build Coastguard Worker };
237*9356374aSAndroid Build Coastguard Worker
238*9356374aSAndroid Build Coastguard Worker // Decimal-to-binary conversions require coercing powers of 10 into a mantissa
239*9356374aSAndroid Build Coastguard Worker // and a power of 2. The two helper functions Power10Mantissa(n) and
240*9356374aSAndroid Build Coastguard Worker // Power10Exponent(n) perform this task. Together, these represent a hand-
241*9356374aSAndroid Build Coastguard Worker // rolled floating point value which is equal to or just less than 10**n.
242*9356374aSAndroid Build Coastguard Worker //
243*9356374aSAndroid Build Coastguard Worker // The return values satisfy two range guarantees:
244*9356374aSAndroid Build Coastguard Worker //
245*9356374aSAndroid Build Coastguard Worker // Power10Mantissa(n) * 2**Power10Exponent(n) <= 10**n
246*9356374aSAndroid Build Coastguard Worker // < (Power10Mantissa(n) + 1) * 2**Power10Exponent(n)
247*9356374aSAndroid Build Coastguard Worker //
248*9356374aSAndroid Build Coastguard Worker // 2**63 <= Power10Mantissa(n) < 2**64.
249*9356374aSAndroid Build Coastguard Worker //
250*9356374aSAndroid Build Coastguard Worker // See the "Table of powers of 10" comment below for a "1e60" example.
251*9356374aSAndroid Build Coastguard Worker //
252*9356374aSAndroid Build Coastguard Worker // Lookups into the power-of-10 table must first check the Power10Overflow() and
253*9356374aSAndroid Build Coastguard Worker // Power10Underflow() functions, to avoid out-of-bounds table access.
254*9356374aSAndroid Build Coastguard Worker //
255*9356374aSAndroid Build Coastguard Worker // Indexes into these tables are biased by -kPower10TableMinInclusive. Valid
256*9356374aSAndroid Build Coastguard Worker // indexes range from kPower10TableMinInclusive to kPower10TableMaxExclusive.
257*9356374aSAndroid Build Coastguard Worker extern const uint64_t kPower10MantissaHighTable[]; // High 64 of 128 bits.
258*9356374aSAndroid Build Coastguard Worker extern const uint64_t kPower10MantissaLowTable[]; // Low 64 of 128 bits.
259*9356374aSAndroid Build Coastguard Worker
260*9356374aSAndroid Build Coastguard Worker // The smallest (inclusive) allowed value for use with the Power10Mantissa()
261*9356374aSAndroid Build Coastguard Worker // and Power10Exponent() functions below. (If a smaller exponent is needed in
262*9356374aSAndroid Build Coastguard Worker // calculations, the end result is guaranteed to underflow.)
263*9356374aSAndroid Build Coastguard Worker constexpr int kPower10TableMinInclusive = -342;
264*9356374aSAndroid Build Coastguard Worker
265*9356374aSAndroid Build Coastguard Worker // The largest (exclusive) allowed value for use with the Power10Mantissa() and
266*9356374aSAndroid Build Coastguard Worker // Power10Exponent() functions below. (If a larger-or-equal exponent is needed
267*9356374aSAndroid Build Coastguard Worker // in calculations, the end result is guaranteed to overflow.)
268*9356374aSAndroid Build Coastguard Worker constexpr int kPower10TableMaxExclusive = 309;
269*9356374aSAndroid Build Coastguard Worker
Power10Mantissa(int n)270*9356374aSAndroid Build Coastguard Worker uint64_t Power10Mantissa(int n) {
271*9356374aSAndroid Build Coastguard Worker return kPower10MantissaHighTable[n - kPower10TableMinInclusive];
272*9356374aSAndroid Build Coastguard Worker }
273*9356374aSAndroid Build Coastguard Worker
Power10Exponent(int n)274*9356374aSAndroid Build Coastguard Worker int Power10Exponent(int n) {
275*9356374aSAndroid Build Coastguard Worker // The 217706 etc magic numbers encode the results as a formula instead of a
276*9356374aSAndroid Build Coastguard Worker // table. Their equivalence (over the kPower10TableMinInclusive ..
277*9356374aSAndroid Build Coastguard Worker // kPower10TableMaxExclusive range) is confirmed by
278*9356374aSAndroid Build Coastguard Worker // https://github.com/google/wuffs/blob/315b2e52625ebd7b02d8fac13e3cd85ea374fb80/script/print-mpb-powers-of-10.go
279*9356374aSAndroid Build Coastguard Worker return (217706 * n >> 16) - 63;
280*9356374aSAndroid Build Coastguard Worker }
281*9356374aSAndroid Build Coastguard Worker
282*9356374aSAndroid Build Coastguard Worker // Returns true if n is large enough that 10**n always results in an IEEE
283*9356374aSAndroid Build Coastguard Worker // overflow.
Power10Overflow(int n)284*9356374aSAndroid Build Coastguard Worker bool Power10Overflow(int n) { return n >= kPower10TableMaxExclusive; }
285*9356374aSAndroid Build Coastguard Worker
286*9356374aSAndroid Build Coastguard Worker // Returns true if n is small enough that 10**n times a ParsedFloat mantissa
287*9356374aSAndroid Build Coastguard Worker // always results in an IEEE underflow.
Power10Underflow(int n)288*9356374aSAndroid Build Coastguard Worker bool Power10Underflow(int n) { return n < kPower10TableMinInclusive; }
289*9356374aSAndroid Build Coastguard Worker
290*9356374aSAndroid Build Coastguard Worker // Returns true if Power10Mantissa(n) * 2**Power10Exponent(n) is exactly equal
291*9356374aSAndroid Build Coastguard Worker // to 10**n numerically. Put another way, this returns true if there is no
292*9356374aSAndroid Build Coastguard Worker // truncation error in Power10Mantissa(n).
Power10Exact(int n)293*9356374aSAndroid Build Coastguard Worker bool Power10Exact(int n) { return n >= 0 && n <= 27; }
294*9356374aSAndroid Build Coastguard Worker
295*9356374aSAndroid Build Coastguard Worker // Sentinel exponent values for representing numbers too large or too close to
296*9356374aSAndroid Build Coastguard Worker // zero to represent in a double.
297*9356374aSAndroid Build Coastguard Worker constexpr int kOverflow = 99999;
298*9356374aSAndroid Build Coastguard Worker constexpr int kUnderflow = -99999;
299*9356374aSAndroid Build Coastguard Worker
300*9356374aSAndroid Build Coastguard Worker // Struct representing the calculated conversion result of a positive (nonzero)
301*9356374aSAndroid Build Coastguard Worker // floating point number.
302*9356374aSAndroid Build Coastguard Worker //
303*9356374aSAndroid Build Coastguard Worker // The calculated number is mantissa * 2**exponent (mantissa is treated as an
304*9356374aSAndroid Build Coastguard Worker // integer.) `mantissa` is chosen to be the correct width for the IEEE float
305*9356374aSAndroid Build Coastguard Worker // representation being calculated. (`mantissa` will always have the same bit
306*9356374aSAndroid Build Coastguard Worker // width for normal values, and narrower bit widths for subnormals.)
307*9356374aSAndroid Build Coastguard Worker //
308*9356374aSAndroid Build Coastguard Worker // If the result of conversion was an underflow or overflow, exponent is set
309*9356374aSAndroid Build Coastguard Worker // to kUnderflow or kOverflow.
310*9356374aSAndroid Build Coastguard Worker struct CalculatedFloat {
311*9356374aSAndroid Build Coastguard Worker uint64_t mantissa = 0;
312*9356374aSAndroid Build Coastguard Worker int exponent = 0;
313*9356374aSAndroid Build Coastguard Worker };
314*9356374aSAndroid Build Coastguard Worker
315*9356374aSAndroid Build Coastguard Worker // Returns the bit width of the given uint128. (Equivalently, returns 128
316*9356374aSAndroid Build Coastguard Worker // minus the number of leading zero bits.)
BitWidth(uint128 value)317*9356374aSAndroid Build Coastguard Worker int BitWidth(uint128 value) {
318*9356374aSAndroid Build Coastguard Worker if (Uint128High64(value) == 0) {
319*9356374aSAndroid Build Coastguard Worker // This static_cast is only needed when using a std::bit_width()
320*9356374aSAndroid Build Coastguard Worker // implementation that does not have the fix for LWG 3656 applied.
321*9356374aSAndroid Build Coastguard Worker return static_cast<int>(bit_width(Uint128Low64(value)));
322*9356374aSAndroid Build Coastguard Worker }
323*9356374aSAndroid Build Coastguard Worker return 128 - countl_zero(Uint128High64(value));
324*9356374aSAndroid Build Coastguard Worker }
325*9356374aSAndroid Build Coastguard Worker
326*9356374aSAndroid Build Coastguard Worker // Calculates how far to the right a mantissa needs to be shifted to create a
327*9356374aSAndroid Build Coastguard Worker // properly adjusted mantissa for an IEEE floating point number.
328*9356374aSAndroid Build Coastguard Worker //
329*9356374aSAndroid Build Coastguard Worker // `mantissa_width` is the bit width of the mantissa to be shifted, and
330*9356374aSAndroid Build Coastguard Worker // `binary_exponent` is the exponent of the number before the shift.
331*9356374aSAndroid Build Coastguard Worker //
332*9356374aSAndroid Build Coastguard Worker // This accounts for subnormal values, and will return a larger-than-normal
333*9356374aSAndroid Build Coastguard Worker // shift if binary_exponent would otherwise be too low.
334*9356374aSAndroid Build Coastguard Worker template <typename FloatType>
NormalizedShiftSize(int mantissa_width,int binary_exponent)335*9356374aSAndroid Build Coastguard Worker int NormalizedShiftSize(int mantissa_width, int binary_exponent) {
336*9356374aSAndroid Build Coastguard Worker const int normal_shift =
337*9356374aSAndroid Build Coastguard Worker mantissa_width - FloatTraits<FloatType>::kTargetMantissaBits;
338*9356374aSAndroid Build Coastguard Worker const int minimum_shift =
339*9356374aSAndroid Build Coastguard Worker FloatTraits<FloatType>::kMinNormalExponent - binary_exponent;
340*9356374aSAndroid Build Coastguard Worker return std::max(normal_shift, minimum_shift);
341*9356374aSAndroid Build Coastguard Worker }
342*9356374aSAndroid Build Coastguard Worker
343*9356374aSAndroid Build Coastguard Worker // Right shifts a uint128 so that it has the requested bit width. (The
344*9356374aSAndroid Build Coastguard Worker // resulting value will have 128 - bit_width leading zeroes.) The initial
345*9356374aSAndroid Build Coastguard Worker // `value` must be wider than the requested bit width.
346*9356374aSAndroid Build Coastguard Worker //
347*9356374aSAndroid Build Coastguard Worker // Returns the number of bits shifted.
TruncateToBitWidth(int bit_width,absl::Nonnull<uint128 * > value)348*9356374aSAndroid Build Coastguard Worker int TruncateToBitWidth(int bit_width, absl::Nonnull<uint128*> value) {
349*9356374aSAndroid Build Coastguard Worker const int current_bit_width = BitWidth(*value);
350*9356374aSAndroid Build Coastguard Worker const int shift = current_bit_width - bit_width;
351*9356374aSAndroid Build Coastguard Worker *value >>= shift;
352*9356374aSAndroid Build Coastguard Worker return shift;
353*9356374aSAndroid Build Coastguard Worker }
354*9356374aSAndroid Build Coastguard Worker
355*9356374aSAndroid Build Coastguard Worker // Checks if the given ParsedFloat represents one of the edge cases that are
356*9356374aSAndroid Build Coastguard Worker // not dependent on number base: zero, infinity, or NaN. If so, sets *value
357*9356374aSAndroid Build Coastguard Worker // the appropriate double, and returns true.
358*9356374aSAndroid Build Coastguard Worker template <typename FloatType>
HandleEdgeCase(const strings_internal::ParsedFloat & input,bool negative,absl::Nonnull<FloatType * > value)359*9356374aSAndroid Build Coastguard Worker bool HandleEdgeCase(const strings_internal::ParsedFloat& input, bool negative,
360*9356374aSAndroid Build Coastguard Worker absl::Nonnull<FloatType*> value) {
361*9356374aSAndroid Build Coastguard Worker if (input.type == strings_internal::FloatType::kNan) {
362*9356374aSAndroid Build Coastguard Worker // A bug in both clang < 7 and gcc would cause the compiler to optimize
363*9356374aSAndroid Build Coastguard Worker // away the buffer we are building below. Declaring the buffer volatile
364*9356374aSAndroid Build Coastguard Worker // avoids the issue, and has no measurable performance impact in
365*9356374aSAndroid Build Coastguard Worker // microbenchmarks.
366*9356374aSAndroid Build Coastguard Worker //
367*9356374aSAndroid Build Coastguard Worker // https://bugs.llvm.org/show_bug.cgi?id=37778
368*9356374aSAndroid Build Coastguard Worker // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86113
369*9356374aSAndroid Build Coastguard Worker constexpr ptrdiff_t kNanBufferSize = 128;
370*9356374aSAndroid Build Coastguard Worker #if (defined(__GNUC__) && !defined(__clang__)) || \
371*9356374aSAndroid Build Coastguard Worker (defined(__clang__) && __clang_major__ < 7)
372*9356374aSAndroid Build Coastguard Worker volatile char n_char_sequence[kNanBufferSize];
373*9356374aSAndroid Build Coastguard Worker #else
374*9356374aSAndroid Build Coastguard Worker char n_char_sequence[kNanBufferSize];
375*9356374aSAndroid Build Coastguard Worker #endif
376*9356374aSAndroid Build Coastguard Worker if (input.subrange_begin == nullptr) {
377*9356374aSAndroid Build Coastguard Worker n_char_sequence[0] = '\0';
378*9356374aSAndroid Build Coastguard Worker } else {
379*9356374aSAndroid Build Coastguard Worker ptrdiff_t nan_size = input.subrange_end - input.subrange_begin;
380*9356374aSAndroid Build Coastguard Worker nan_size = std::min(nan_size, kNanBufferSize - 1);
381*9356374aSAndroid Build Coastguard Worker std::copy_n(input.subrange_begin, nan_size, n_char_sequence);
382*9356374aSAndroid Build Coastguard Worker n_char_sequence[nan_size] = '\0';
383*9356374aSAndroid Build Coastguard Worker }
384*9356374aSAndroid Build Coastguard Worker char* nan_argument = const_cast<char*>(n_char_sequence);
385*9356374aSAndroid Build Coastguard Worker *value = negative ? -FloatTraits<FloatType>::MakeNan(nan_argument)
386*9356374aSAndroid Build Coastguard Worker : FloatTraits<FloatType>::MakeNan(nan_argument);
387*9356374aSAndroid Build Coastguard Worker return true;
388*9356374aSAndroid Build Coastguard Worker }
389*9356374aSAndroid Build Coastguard Worker if (input.type == strings_internal::FloatType::kInfinity) {
390*9356374aSAndroid Build Coastguard Worker *value = negative ? -std::numeric_limits<FloatType>::infinity()
391*9356374aSAndroid Build Coastguard Worker : std::numeric_limits<FloatType>::infinity();
392*9356374aSAndroid Build Coastguard Worker return true;
393*9356374aSAndroid Build Coastguard Worker }
394*9356374aSAndroid Build Coastguard Worker if (input.mantissa == 0) {
395*9356374aSAndroid Build Coastguard Worker *value = negative ? -0.0 : 0.0;
396*9356374aSAndroid Build Coastguard Worker return true;
397*9356374aSAndroid Build Coastguard Worker }
398*9356374aSAndroid Build Coastguard Worker return false;
399*9356374aSAndroid Build Coastguard Worker }
400*9356374aSAndroid Build Coastguard Worker
401*9356374aSAndroid Build Coastguard Worker // Given a CalculatedFloat result of a from_chars conversion, generate the
402*9356374aSAndroid Build Coastguard Worker // correct output values.
403*9356374aSAndroid Build Coastguard Worker //
404*9356374aSAndroid Build Coastguard Worker // CalculatedFloat can represent an underflow or overflow, in which case the
405*9356374aSAndroid Build Coastguard Worker // error code in *result is set. Otherwise, the calculated floating point
406*9356374aSAndroid Build Coastguard Worker // number is stored in *value.
407*9356374aSAndroid Build Coastguard Worker template <typename FloatType>
EncodeResult(const CalculatedFloat & calculated,bool negative,absl::Nonnull<absl::from_chars_result * > result,absl::Nonnull<FloatType * > value)408*9356374aSAndroid Build Coastguard Worker void EncodeResult(const CalculatedFloat& calculated, bool negative,
409*9356374aSAndroid Build Coastguard Worker absl::Nonnull<absl::from_chars_result*> result,
410*9356374aSAndroid Build Coastguard Worker absl::Nonnull<FloatType*> value) {
411*9356374aSAndroid Build Coastguard Worker if (calculated.exponent == kOverflow) {
412*9356374aSAndroid Build Coastguard Worker result->ec = std::errc::result_out_of_range;
413*9356374aSAndroid Build Coastguard Worker *value = negative ? -std::numeric_limits<FloatType>::max()
414*9356374aSAndroid Build Coastguard Worker : std::numeric_limits<FloatType>::max();
415*9356374aSAndroid Build Coastguard Worker return;
416*9356374aSAndroid Build Coastguard Worker } else if (calculated.mantissa == 0 || calculated.exponent == kUnderflow) {
417*9356374aSAndroid Build Coastguard Worker result->ec = std::errc::result_out_of_range;
418*9356374aSAndroid Build Coastguard Worker *value = negative ? -0.0 : 0.0;
419*9356374aSAndroid Build Coastguard Worker return;
420*9356374aSAndroid Build Coastguard Worker }
421*9356374aSAndroid Build Coastguard Worker *value = FloatTraits<FloatType>::Make(
422*9356374aSAndroid Build Coastguard Worker static_cast<typename FloatTraits<FloatType>::mantissa_t>(
423*9356374aSAndroid Build Coastguard Worker calculated.mantissa),
424*9356374aSAndroid Build Coastguard Worker calculated.exponent, negative);
425*9356374aSAndroid Build Coastguard Worker }
426*9356374aSAndroid Build Coastguard Worker
427*9356374aSAndroid Build Coastguard Worker // Returns the given uint128 shifted to the right by `shift` bits, and rounds
428*9356374aSAndroid Build Coastguard Worker // the remaining bits using round_to_nearest logic. The value is returned as a
429*9356374aSAndroid Build Coastguard Worker // uint64_t, since this is the type used by this library for storing calculated
430*9356374aSAndroid Build Coastguard Worker // floating point mantissas.
431*9356374aSAndroid Build Coastguard Worker //
432*9356374aSAndroid Build Coastguard Worker // It is expected that the width of the input value shifted by `shift` will
433*9356374aSAndroid Build Coastguard Worker // be the correct bit-width for the target mantissa, which is strictly narrower
434*9356374aSAndroid Build Coastguard Worker // than a uint64_t.
435*9356374aSAndroid Build Coastguard Worker //
436*9356374aSAndroid Build Coastguard Worker // If `input_exact` is false, then a nonzero error epsilon is assumed. For
437*9356374aSAndroid Build Coastguard Worker // rounding purposes, the true value being rounded is strictly greater than the
438*9356374aSAndroid Build Coastguard Worker // input value. The error may represent a single lost carry bit.
439*9356374aSAndroid Build Coastguard Worker //
440*9356374aSAndroid Build Coastguard Worker // When input_exact, shifted bits of the form 1000000... represent a tie, which
441*9356374aSAndroid Build Coastguard Worker // is broken by rounding to even -- the rounding direction is chosen so the low
442*9356374aSAndroid Build Coastguard Worker // bit of the returned value is 0.
443*9356374aSAndroid Build Coastguard Worker //
444*9356374aSAndroid Build Coastguard Worker // When !input_exact, shifted bits of the form 10000000... represent a value
445*9356374aSAndroid Build Coastguard Worker // strictly greater than one half (due to the error epsilon), and so ties are
446*9356374aSAndroid Build Coastguard Worker // always broken by rounding up.
447*9356374aSAndroid Build Coastguard Worker //
448*9356374aSAndroid Build Coastguard Worker // When !input_exact, shifted bits of the form 01111111... are uncertain;
449*9356374aSAndroid Build Coastguard Worker // the true value may or may not be greater than 10000000..., due to the
450*9356374aSAndroid Build Coastguard Worker // possible lost carry bit. The correct rounding direction is unknown. In this
451*9356374aSAndroid Build Coastguard Worker // case, the result is rounded down, and `output_exact` is set to false.
452*9356374aSAndroid Build Coastguard Worker //
453*9356374aSAndroid Build Coastguard Worker // Zero and negative values of `shift` are accepted, in which case the word is
454*9356374aSAndroid Build Coastguard Worker // shifted left, as necessary.
ShiftRightAndRound(uint128 value,int shift,bool input_exact,absl::Nonnull<bool * > output_exact)455*9356374aSAndroid Build Coastguard Worker uint64_t ShiftRightAndRound(uint128 value, int shift, bool input_exact,
456*9356374aSAndroid Build Coastguard Worker absl::Nonnull<bool*> output_exact) {
457*9356374aSAndroid Build Coastguard Worker if (shift <= 0) {
458*9356374aSAndroid Build Coastguard Worker *output_exact = input_exact;
459*9356374aSAndroid Build Coastguard Worker return static_cast<uint64_t>(value << -shift);
460*9356374aSAndroid Build Coastguard Worker }
461*9356374aSAndroid Build Coastguard Worker if (shift >= 128) {
462*9356374aSAndroid Build Coastguard Worker // Exponent is so small that we are shifting away all significant bits.
463*9356374aSAndroid Build Coastguard Worker // Answer will not be representable, even as a subnormal, so return a zero
464*9356374aSAndroid Build Coastguard Worker // mantissa (which represents underflow).
465*9356374aSAndroid Build Coastguard Worker *output_exact = true;
466*9356374aSAndroid Build Coastguard Worker return 0;
467*9356374aSAndroid Build Coastguard Worker }
468*9356374aSAndroid Build Coastguard Worker
469*9356374aSAndroid Build Coastguard Worker *output_exact = true;
470*9356374aSAndroid Build Coastguard Worker const uint128 shift_mask = (uint128(1) << shift) - 1;
471*9356374aSAndroid Build Coastguard Worker const uint128 halfway_point = uint128(1) << (shift - 1);
472*9356374aSAndroid Build Coastguard Worker
473*9356374aSAndroid Build Coastguard Worker const uint128 shifted_bits = value & shift_mask;
474*9356374aSAndroid Build Coastguard Worker value >>= shift;
475*9356374aSAndroid Build Coastguard Worker if (shifted_bits > halfway_point) {
476*9356374aSAndroid Build Coastguard Worker // Shifted bits greater than 10000... require rounding up.
477*9356374aSAndroid Build Coastguard Worker return static_cast<uint64_t>(value + 1);
478*9356374aSAndroid Build Coastguard Worker }
479*9356374aSAndroid Build Coastguard Worker if (shifted_bits == halfway_point) {
480*9356374aSAndroid Build Coastguard Worker // In exact mode, shifted bits of 10000... mean we're exactly halfway
481*9356374aSAndroid Build Coastguard Worker // between two numbers, and we must round to even. So only round up if
482*9356374aSAndroid Build Coastguard Worker // the low bit of `value` is set.
483*9356374aSAndroid Build Coastguard Worker //
484*9356374aSAndroid Build Coastguard Worker // In inexact mode, the nonzero error means the actual value is greater
485*9356374aSAndroid Build Coastguard Worker // than the halfway point and we must always round up.
486*9356374aSAndroid Build Coastguard Worker if ((value & 1) == 1 || !input_exact) {
487*9356374aSAndroid Build Coastguard Worker ++value;
488*9356374aSAndroid Build Coastguard Worker }
489*9356374aSAndroid Build Coastguard Worker return static_cast<uint64_t>(value);
490*9356374aSAndroid Build Coastguard Worker }
491*9356374aSAndroid Build Coastguard Worker if (!input_exact && shifted_bits == halfway_point - 1) {
492*9356374aSAndroid Build Coastguard Worker // Rounding direction is unclear, due to error.
493*9356374aSAndroid Build Coastguard Worker *output_exact = false;
494*9356374aSAndroid Build Coastguard Worker }
495*9356374aSAndroid Build Coastguard Worker // Otherwise, round down.
496*9356374aSAndroid Build Coastguard Worker return static_cast<uint64_t>(value);
497*9356374aSAndroid Build Coastguard Worker }
498*9356374aSAndroid Build Coastguard Worker
499*9356374aSAndroid Build Coastguard Worker // Checks if a floating point guess needs to be rounded up, using high precision
500*9356374aSAndroid Build Coastguard Worker // math.
501*9356374aSAndroid Build Coastguard Worker //
502*9356374aSAndroid Build Coastguard Worker // `guess_mantissa` and `guess_exponent` represent a candidate guess for the
503*9356374aSAndroid Build Coastguard Worker // number represented by `parsed_decimal`.
504*9356374aSAndroid Build Coastguard Worker //
505*9356374aSAndroid Build Coastguard Worker // The exact number represented by `parsed_decimal` must lie between the two
506*9356374aSAndroid Build Coastguard Worker // numbers:
507*9356374aSAndroid Build Coastguard Worker // A = `guess_mantissa * 2**guess_exponent`
508*9356374aSAndroid Build Coastguard Worker // B = `(guess_mantissa + 1) * 2**guess_exponent`
509*9356374aSAndroid Build Coastguard Worker //
510*9356374aSAndroid Build Coastguard Worker // This function returns false if `A` is the better guess, and true if `B` is
511*9356374aSAndroid Build Coastguard Worker // the better guess, with rounding ties broken by rounding to even.
MustRoundUp(uint64_t guess_mantissa,int guess_exponent,const strings_internal::ParsedFloat & parsed_decimal)512*9356374aSAndroid Build Coastguard Worker bool MustRoundUp(uint64_t guess_mantissa, int guess_exponent,
513*9356374aSAndroid Build Coastguard Worker const strings_internal::ParsedFloat& parsed_decimal) {
514*9356374aSAndroid Build Coastguard Worker // 768 is the number of digits needed in the worst case. We could determine a
515*9356374aSAndroid Build Coastguard Worker // better limit dynamically based on the value of parsed_decimal.exponent.
516*9356374aSAndroid Build Coastguard Worker // This would optimize pathological input cases only. (Sane inputs won't have
517*9356374aSAndroid Build Coastguard Worker // hundreds of digits of mantissa.)
518*9356374aSAndroid Build Coastguard Worker absl::strings_internal::BigUnsigned<84> exact_mantissa;
519*9356374aSAndroid Build Coastguard Worker int exact_exponent = exact_mantissa.ReadFloatMantissa(parsed_decimal, 768);
520*9356374aSAndroid Build Coastguard Worker
521*9356374aSAndroid Build Coastguard Worker // Adjust the `guess` arguments to be halfway between A and B.
522*9356374aSAndroid Build Coastguard Worker guess_mantissa = guess_mantissa * 2 + 1;
523*9356374aSAndroid Build Coastguard Worker guess_exponent -= 1;
524*9356374aSAndroid Build Coastguard Worker
525*9356374aSAndroid Build Coastguard Worker // In our comparison:
526*9356374aSAndroid Build Coastguard Worker // lhs = exact = exact_mantissa * 10**exact_exponent
527*9356374aSAndroid Build Coastguard Worker // = exact_mantissa * 5**exact_exponent * 2**exact_exponent
528*9356374aSAndroid Build Coastguard Worker // rhs = guess = guess_mantissa * 2**guess_exponent
529*9356374aSAndroid Build Coastguard Worker //
530*9356374aSAndroid Build Coastguard Worker // Because we are doing integer math, we can't directly deal with negative
531*9356374aSAndroid Build Coastguard Worker // exponents. We instead move these to the other side of the inequality.
532*9356374aSAndroid Build Coastguard Worker absl::strings_internal::BigUnsigned<84>& lhs = exact_mantissa;
533*9356374aSAndroid Build Coastguard Worker int comparison;
534*9356374aSAndroid Build Coastguard Worker if (exact_exponent >= 0) {
535*9356374aSAndroid Build Coastguard Worker lhs.MultiplyByFiveToTheNth(exact_exponent);
536*9356374aSAndroid Build Coastguard Worker absl::strings_internal::BigUnsigned<84> rhs(guess_mantissa);
537*9356374aSAndroid Build Coastguard Worker // There are powers of 2 on both sides of the inequality; reduce this to
538*9356374aSAndroid Build Coastguard Worker // a single bit-shift.
539*9356374aSAndroid Build Coastguard Worker if (exact_exponent > guess_exponent) {
540*9356374aSAndroid Build Coastguard Worker lhs.ShiftLeft(exact_exponent - guess_exponent);
541*9356374aSAndroid Build Coastguard Worker } else {
542*9356374aSAndroid Build Coastguard Worker rhs.ShiftLeft(guess_exponent - exact_exponent);
543*9356374aSAndroid Build Coastguard Worker }
544*9356374aSAndroid Build Coastguard Worker comparison = Compare(lhs, rhs);
545*9356374aSAndroid Build Coastguard Worker } else {
546*9356374aSAndroid Build Coastguard Worker // Move the power of 5 to the other side of the equation, giving us:
547*9356374aSAndroid Build Coastguard Worker // lhs = exact_mantissa * 2**exact_exponent
548*9356374aSAndroid Build Coastguard Worker // rhs = guess_mantissa * 5**(-exact_exponent) * 2**guess_exponent
549*9356374aSAndroid Build Coastguard Worker absl::strings_internal::BigUnsigned<84> rhs =
550*9356374aSAndroid Build Coastguard Worker absl::strings_internal::BigUnsigned<84>::FiveToTheNth(-exact_exponent);
551*9356374aSAndroid Build Coastguard Worker rhs.MultiplyBy(guess_mantissa);
552*9356374aSAndroid Build Coastguard Worker if (exact_exponent > guess_exponent) {
553*9356374aSAndroid Build Coastguard Worker lhs.ShiftLeft(exact_exponent - guess_exponent);
554*9356374aSAndroid Build Coastguard Worker } else {
555*9356374aSAndroid Build Coastguard Worker rhs.ShiftLeft(guess_exponent - exact_exponent);
556*9356374aSAndroid Build Coastguard Worker }
557*9356374aSAndroid Build Coastguard Worker comparison = Compare(lhs, rhs);
558*9356374aSAndroid Build Coastguard Worker }
559*9356374aSAndroid Build Coastguard Worker if (comparison < 0) {
560*9356374aSAndroid Build Coastguard Worker return false;
561*9356374aSAndroid Build Coastguard Worker } else if (comparison > 0) {
562*9356374aSAndroid Build Coastguard Worker return true;
563*9356374aSAndroid Build Coastguard Worker } else {
564*9356374aSAndroid Build Coastguard Worker // When lhs == rhs, the decimal input is exactly between A and B.
565*9356374aSAndroid Build Coastguard Worker // Round towards even -- round up only if the low bit of the initial
566*9356374aSAndroid Build Coastguard Worker // `guess_mantissa` was a 1. We shifted guess_mantissa left 1 bit at
567*9356374aSAndroid Build Coastguard Worker // the beginning of this function, so test the 2nd bit here.
568*9356374aSAndroid Build Coastguard Worker return (guess_mantissa & 2) == 2;
569*9356374aSAndroid Build Coastguard Worker }
570*9356374aSAndroid Build Coastguard Worker }
571*9356374aSAndroid Build Coastguard Worker
572*9356374aSAndroid Build Coastguard Worker // Constructs a CalculatedFloat from a given mantissa and exponent, but
573*9356374aSAndroid Build Coastguard Worker // with the following normalizations applied:
574*9356374aSAndroid Build Coastguard Worker //
575*9356374aSAndroid Build Coastguard Worker // If rounding has caused mantissa to increase just past the allowed bit
576*9356374aSAndroid Build Coastguard Worker // width, shift and adjust exponent.
577*9356374aSAndroid Build Coastguard Worker //
578*9356374aSAndroid Build Coastguard Worker // If exponent is too high, sets kOverflow.
579*9356374aSAndroid Build Coastguard Worker //
580*9356374aSAndroid Build Coastguard Worker // If mantissa is zero (representing a non-zero value not representable, even
581*9356374aSAndroid Build Coastguard Worker // as a subnormal), sets kUnderflow.
582*9356374aSAndroid Build Coastguard Worker template <typename FloatType>
CalculatedFloatFromRawValues(uint64_t mantissa,int exponent)583*9356374aSAndroid Build Coastguard Worker CalculatedFloat CalculatedFloatFromRawValues(uint64_t mantissa, int exponent) {
584*9356374aSAndroid Build Coastguard Worker CalculatedFloat result;
585*9356374aSAndroid Build Coastguard Worker if (mantissa == uint64_t{1} << FloatTraits<FloatType>::kTargetMantissaBits) {
586*9356374aSAndroid Build Coastguard Worker mantissa >>= 1;
587*9356374aSAndroid Build Coastguard Worker exponent += 1;
588*9356374aSAndroid Build Coastguard Worker }
589*9356374aSAndroid Build Coastguard Worker if (exponent > FloatTraits<FloatType>::kMaxExponent) {
590*9356374aSAndroid Build Coastguard Worker result.exponent = kOverflow;
591*9356374aSAndroid Build Coastguard Worker } else if (mantissa == 0) {
592*9356374aSAndroid Build Coastguard Worker result.exponent = kUnderflow;
593*9356374aSAndroid Build Coastguard Worker } else {
594*9356374aSAndroid Build Coastguard Worker result.exponent = exponent;
595*9356374aSAndroid Build Coastguard Worker result.mantissa = mantissa;
596*9356374aSAndroid Build Coastguard Worker }
597*9356374aSAndroid Build Coastguard Worker return result;
598*9356374aSAndroid Build Coastguard Worker }
599*9356374aSAndroid Build Coastguard Worker
600*9356374aSAndroid Build Coastguard Worker template <typename FloatType>
CalculateFromParsedHexadecimal(const strings_internal::ParsedFloat & parsed_hex)601*9356374aSAndroid Build Coastguard Worker CalculatedFloat CalculateFromParsedHexadecimal(
602*9356374aSAndroid Build Coastguard Worker const strings_internal::ParsedFloat& parsed_hex) {
603*9356374aSAndroid Build Coastguard Worker uint64_t mantissa = parsed_hex.mantissa;
604*9356374aSAndroid Build Coastguard Worker int exponent = parsed_hex.exponent;
605*9356374aSAndroid Build Coastguard Worker // This static_cast is only needed when using a std::bit_width()
606*9356374aSAndroid Build Coastguard Worker // implementation that does not have the fix for LWG 3656 applied.
607*9356374aSAndroid Build Coastguard Worker int mantissa_width = static_cast<int>(bit_width(mantissa));
608*9356374aSAndroid Build Coastguard Worker const int shift = NormalizedShiftSize<FloatType>(mantissa_width, exponent);
609*9356374aSAndroid Build Coastguard Worker bool result_exact;
610*9356374aSAndroid Build Coastguard Worker exponent += shift;
611*9356374aSAndroid Build Coastguard Worker mantissa = ShiftRightAndRound(mantissa, shift,
612*9356374aSAndroid Build Coastguard Worker /* input exact= */ true, &result_exact);
613*9356374aSAndroid Build Coastguard Worker // ParseFloat handles rounding in the hexadecimal case, so we don't have to
614*9356374aSAndroid Build Coastguard Worker // check `result_exact` here.
615*9356374aSAndroid Build Coastguard Worker return CalculatedFloatFromRawValues<FloatType>(mantissa, exponent);
616*9356374aSAndroid Build Coastguard Worker }
617*9356374aSAndroid Build Coastguard Worker
618*9356374aSAndroid Build Coastguard Worker template <typename FloatType>
CalculateFromParsedDecimal(const strings_internal::ParsedFloat & parsed_decimal)619*9356374aSAndroid Build Coastguard Worker CalculatedFloat CalculateFromParsedDecimal(
620*9356374aSAndroid Build Coastguard Worker const strings_internal::ParsedFloat& parsed_decimal) {
621*9356374aSAndroid Build Coastguard Worker CalculatedFloat result;
622*9356374aSAndroid Build Coastguard Worker
623*9356374aSAndroid Build Coastguard Worker // Large or small enough decimal exponents will always result in overflow
624*9356374aSAndroid Build Coastguard Worker // or underflow.
625*9356374aSAndroid Build Coastguard Worker if (Power10Underflow(parsed_decimal.exponent)) {
626*9356374aSAndroid Build Coastguard Worker result.exponent = kUnderflow;
627*9356374aSAndroid Build Coastguard Worker return result;
628*9356374aSAndroid Build Coastguard Worker } else if (Power10Overflow(parsed_decimal.exponent)) {
629*9356374aSAndroid Build Coastguard Worker result.exponent = kOverflow;
630*9356374aSAndroid Build Coastguard Worker return result;
631*9356374aSAndroid Build Coastguard Worker }
632*9356374aSAndroid Build Coastguard Worker
633*9356374aSAndroid Build Coastguard Worker // Otherwise convert our power of 10 into a power of 2 times an integer
634*9356374aSAndroid Build Coastguard Worker // mantissa, and multiply this by our parsed decimal mantissa.
635*9356374aSAndroid Build Coastguard Worker uint128 wide_binary_mantissa = parsed_decimal.mantissa;
636*9356374aSAndroid Build Coastguard Worker wide_binary_mantissa *= Power10Mantissa(parsed_decimal.exponent);
637*9356374aSAndroid Build Coastguard Worker int binary_exponent = Power10Exponent(parsed_decimal.exponent);
638*9356374aSAndroid Build Coastguard Worker
639*9356374aSAndroid Build Coastguard Worker // Discard bits that are inaccurate due to truncation error. The magic
640*9356374aSAndroid Build Coastguard Worker // `mantissa_width` constants below are justified in
641*9356374aSAndroid Build Coastguard Worker // https://abseil.io/about/design/charconv. They represent the number of bits
642*9356374aSAndroid Build Coastguard Worker // in `wide_binary_mantissa` that are guaranteed to be unaffected by error
643*9356374aSAndroid Build Coastguard Worker // propagation.
644*9356374aSAndroid Build Coastguard Worker bool mantissa_exact;
645*9356374aSAndroid Build Coastguard Worker int mantissa_width;
646*9356374aSAndroid Build Coastguard Worker if (parsed_decimal.subrange_begin) {
647*9356374aSAndroid Build Coastguard Worker // Truncated mantissa
648*9356374aSAndroid Build Coastguard Worker mantissa_width = 58;
649*9356374aSAndroid Build Coastguard Worker mantissa_exact = false;
650*9356374aSAndroid Build Coastguard Worker binary_exponent +=
651*9356374aSAndroid Build Coastguard Worker TruncateToBitWidth(mantissa_width, &wide_binary_mantissa);
652*9356374aSAndroid Build Coastguard Worker } else if (!Power10Exact(parsed_decimal.exponent)) {
653*9356374aSAndroid Build Coastguard Worker // Exact mantissa, truncated power of ten
654*9356374aSAndroid Build Coastguard Worker mantissa_width = 63;
655*9356374aSAndroid Build Coastguard Worker mantissa_exact = false;
656*9356374aSAndroid Build Coastguard Worker binary_exponent +=
657*9356374aSAndroid Build Coastguard Worker TruncateToBitWidth(mantissa_width, &wide_binary_mantissa);
658*9356374aSAndroid Build Coastguard Worker } else {
659*9356374aSAndroid Build Coastguard Worker // Product is exact
660*9356374aSAndroid Build Coastguard Worker mantissa_width = BitWidth(wide_binary_mantissa);
661*9356374aSAndroid Build Coastguard Worker mantissa_exact = true;
662*9356374aSAndroid Build Coastguard Worker }
663*9356374aSAndroid Build Coastguard Worker
664*9356374aSAndroid Build Coastguard Worker // Shift into an FloatType-sized mantissa, and round to nearest.
665*9356374aSAndroid Build Coastguard Worker const int shift =
666*9356374aSAndroid Build Coastguard Worker NormalizedShiftSize<FloatType>(mantissa_width, binary_exponent);
667*9356374aSAndroid Build Coastguard Worker bool result_exact;
668*9356374aSAndroid Build Coastguard Worker binary_exponent += shift;
669*9356374aSAndroid Build Coastguard Worker uint64_t binary_mantissa = ShiftRightAndRound(wide_binary_mantissa, shift,
670*9356374aSAndroid Build Coastguard Worker mantissa_exact, &result_exact);
671*9356374aSAndroid Build Coastguard Worker if (!result_exact) {
672*9356374aSAndroid Build Coastguard Worker // We could not determine the rounding direction using int128 math. Use
673*9356374aSAndroid Build Coastguard Worker // full resolution math instead.
674*9356374aSAndroid Build Coastguard Worker if (MustRoundUp(binary_mantissa, binary_exponent, parsed_decimal)) {
675*9356374aSAndroid Build Coastguard Worker binary_mantissa += 1;
676*9356374aSAndroid Build Coastguard Worker }
677*9356374aSAndroid Build Coastguard Worker }
678*9356374aSAndroid Build Coastguard Worker
679*9356374aSAndroid Build Coastguard Worker return CalculatedFloatFromRawValues<FloatType>(binary_mantissa,
680*9356374aSAndroid Build Coastguard Worker binary_exponent);
681*9356374aSAndroid Build Coastguard Worker }
682*9356374aSAndroid Build Coastguard Worker
683*9356374aSAndroid Build Coastguard Worker // As discussed in https://nigeltao.github.io/blog/2020/eisel-lemire.html the
684*9356374aSAndroid Build Coastguard Worker // primary goal of the Eisel-Lemire algorithm is speed, for 99+% of the cases,
685*9356374aSAndroid Build Coastguard Worker // not 100% coverage. As long as Eisel-Lemire doesn’t claim false positives,
686*9356374aSAndroid Build Coastguard Worker // the combined approach (falling back to an alternative implementation when
687*9356374aSAndroid Build Coastguard Worker // this function returns false) is both fast and correct.
688*9356374aSAndroid Build Coastguard Worker template <typename FloatType>
EiselLemire(const strings_internal::ParsedFloat & input,bool negative,absl::Nonnull<FloatType * > value,absl::Nonnull<std::errc * > ec)689*9356374aSAndroid Build Coastguard Worker bool EiselLemire(const strings_internal::ParsedFloat& input, bool negative,
690*9356374aSAndroid Build Coastguard Worker absl::Nonnull<FloatType*> value,
691*9356374aSAndroid Build Coastguard Worker absl::Nonnull<std::errc*> ec) {
692*9356374aSAndroid Build Coastguard Worker uint64_t man = input.mantissa;
693*9356374aSAndroid Build Coastguard Worker int exp10 = input.exponent;
694*9356374aSAndroid Build Coastguard Worker if (exp10 < FloatTraits<FloatType>::kEiselLemireMinInclusiveExp10) {
695*9356374aSAndroid Build Coastguard Worker *value = negative ? -0.0 : 0.0;
696*9356374aSAndroid Build Coastguard Worker *ec = std::errc::result_out_of_range;
697*9356374aSAndroid Build Coastguard Worker return true;
698*9356374aSAndroid Build Coastguard Worker } else if (exp10 >= FloatTraits<FloatType>::kEiselLemireMaxExclusiveExp10) {
699*9356374aSAndroid Build Coastguard Worker // Return max (a finite value) consistent with from_chars and DR 3081. For
700*9356374aSAndroid Build Coastguard Worker // SimpleAtod and SimpleAtof, post-processing will return infinity.
701*9356374aSAndroid Build Coastguard Worker *value = negative ? -std::numeric_limits<FloatType>::max()
702*9356374aSAndroid Build Coastguard Worker : std::numeric_limits<FloatType>::max();
703*9356374aSAndroid Build Coastguard Worker *ec = std::errc::result_out_of_range;
704*9356374aSAndroid Build Coastguard Worker return true;
705*9356374aSAndroid Build Coastguard Worker }
706*9356374aSAndroid Build Coastguard Worker
707*9356374aSAndroid Build Coastguard Worker // Assert kPower10TableMinInclusive <= exp10 < kPower10TableMaxExclusive.
708*9356374aSAndroid Build Coastguard Worker // Equivalently, !Power10Underflow(exp10) and !Power10Overflow(exp10).
709*9356374aSAndroid Build Coastguard Worker static_assert(
710*9356374aSAndroid Build Coastguard Worker FloatTraits<FloatType>::kEiselLemireMinInclusiveExp10 >=
711*9356374aSAndroid Build Coastguard Worker kPower10TableMinInclusive,
712*9356374aSAndroid Build Coastguard Worker "(exp10-kPower10TableMinInclusive) in kPower10MantissaHighTable bounds");
713*9356374aSAndroid Build Coastguard Worker static_assert(
714*9356374aSAndroid Build Coastguard Worker FloatTraits<FloatType>::kEiselLemireMaxExclusiveExp10 <=
715*9356374aSAndroid Build Coastguard Worker kPower10TableMaxExclusive,
716*9356374aSAndroid Build Coastguard Worker "(exp10-kPower10TableMinInclusive) in kPower10MantissaHighTable bounds");
717*9356374aSAndroid Build Coastguard Worker
718*9356374aSAndroid Build Coastguard Worker // The terse (+) comments in this function body refer to sections of the
719*9356374aSAndroid Build Coastguard Worker // https://nigeltao.github.io/blog/2020/eisel-lemire.html blog post.
720*9356374aSAndroid Build Coastguard Worker //
721*9356374aSAndroid Build Coastguard Worker // That blog post discusses double precision (11 exponent bits with a -1023
722*9356374aSAndroid Build Coastguard Worker // bias, 52 mantissa bits), but the same approach applies to single precision
723*9356374aSAndroid Build Coastguard Worker // (8 exponent bits with a -127 bias, 23 mantissa bits). Either way, the
724*9356374aSAndroid Build Coastguard Worker // computation here happens with 64-bit values (e.g. man) or 128-bit values
725*9356374aSAndroid Build Coastguard Worker // (e.g. x) before finally converting to 64- or 32-bit floating point.
726*9356374aSAndroid Build Coastguard Worker //
727*9356374aSAndroid Build Coastguard Worker // See also "Number Parsing at a Gigabyte per Second, Software: Practice and
728*9356374aSAndroid Build Coastguard Worker // Experience 51 (8), 2021" (https://arxiv.org/abs/2101.11408) for detail.
729*9356374aSAndroid Build Coastguard Worker
730*9356374aSAndroid Build Coastguard Worker // (+) Normalization.
731*9356374aSAndroid Build Coastguard Worker int clz = countl_zero(man);
732*9356374aSAndroid Build Coastguard Worker man <<= static_cast<unsigned int>(clz);
733*9356374aSAndroid Build Coastguard Worker // The 217706 etc magic numbers are from the Power10Exponent function.
734*9356374aSAndroid Build Coastguard Worker uint64_t ret_exp2 =
735*9356374aSAndroid Build Coastguard Worker static_cast<uint64_t>((217706 * exp10 >> 16) + 64 +
736*9356374aSAndroid Build Coastguard Worker FloatTraits<FloatType>::kExponentBias - clz);
737*9356374aSAndroid Build Coastguard Worker
738*9356374aSAndroid Build Coastguard Worker // (+) Multiplication.
739*9356374aSAndroid Build Coastguard Worker uint128 x = static_cast<uint128>(man) *
740*9356374aSAndroid Build Coastguard Worker static_cast<uint128>(
741*9356374aSAndroid Build Coastguard Worker kPower10MantissaHighTable[exp10 - kPower10TableMinInclusive]);
742*9356374aSAndroid Build Coastguard Worker
743*9356374aSAndroid Build Coastguard Worker // (+) Wider Approximation.
744*9356374aSAndroid Build Coastguard Worker static constexpr uint64_t high64_mask =
745*9356374aSAndroid Build Coastguard Worker FloatTraits<FloatType>::kEiselLemireMask;
746*9356374aSAndroid Build Coastguard Worker if (((Uint128High64(x) & high64_mask) == high64_mask) &&
747*9356374aSAndroid Build Coastguard Worker (man > (std::numeric_limits<uint64_t>::max() - Uint128Low64(x)))) {
748*9356374aSAndroid Build Coastguard Worker uint128 y =
749*9356374aSAndroid Build Coastguard Worker static_cast<uint128>(man) *
750*9356374aSAndroid Build Coastguard Worker static_cast<uint128>(
751*9356374aSAndroid Build Coastguard Worker kPower10MantissaLowTable[exp10 - kPower10TableMinInclusive]);
752*9356374aSAndroid Build Coastguard Worker x += Uint128High64(y);
753*9356374aSAndroid Build Coastguard Worker // For example, parsing "4503599627370497.5" will take the if-true
754*9356374aSAndroid Build Coastguard Worker // branch here (for double precision), since:
755*9356374aSAndroid Build Coastguard Worker // - x = 0x8000000000000BFF_FFFFFFFFFFFFFFFF
756*9356374aSAndroid Build Coastguard Worker // - y = 0x8000000000000BFF_7FFFFFFFFFFFF400
757*9356374aSAndroid Build Coastguard Worker // - man = 0xA000000000000F00
758*9356374aSAndroid Build Coastguard Worker // Likewise, when parsing "0.0625" for single precision:
759*9356374aSAndroid Build Coastguard Worker // - x = 0x7FFFFFFFFFFFFFFF_FFFFFFFFFFFFFFFF
760*9356374aSAndroid Build Coastguard Worker // - y = 0x813FFFFFFFFFFFFF_8A00000000000000
761*9356374aSAndroid Build Coastguard Worker // - man = 0x9C40000000000000
762*9356374aSAndroid Build Coastguard Worker if (((Uint128High64(x) & high64_mask) == high64_mask) &&
763*9356374aSAndroid Build Coastguard Worker ((Uint128Low64(x) + 1) == 0) &&
764*9356374aSAndroid Build Coastguard Worker (man > (std::numeric_limits<uint64_t>::max() - Uint128Low64(y)))) {
765*9356374aSAndroid Build Coastguard Worker return false;
766*9356374aSAndroid Build Coastguard Worker }
767*9356374aSAndroid Build Coastguard Worker }
768*9356374aSAndroid Build Coastguard Worker
769*9356374aSAndroid Build Coastguard Worker // (+) Shifting to 54 Bits (or for single precision, to 25 bits).
770*9356374aSAndroid Build Coastguard Worker uint64_t msb = Uint128High64(x) >> 63;
771*9356374aSAndroid Build Coastguard Worker uint64_t ret_man =
772*9356374aSAndroid Build Coastguard Worker Uint128High64(x) >> (msb + FloatTraits<FloatType>::kEiselLemireShift);
773*9356374aSAndroid Build Coastguard Worker ret_exp2 -= 1 ^ msb;
774*9356374aSAndroid Build Coastguard Worker
775*9356374aSAndroid Build Coastguard Worker // (+) Half-way Ambiguity.
776*9356374aSAndroid Build Coastguard Worker //
777*9356374aSAndroid Build Coastguard Worker // For example, parsing "1e+23" will take the if-true branch here (for double
778*9356374aSAndroid Build Coastguard Worker // precision), since:
779*9356374aSAndroid Build Coastguard Worker // - x = 0x54B40B1F852BDA00_0000000000000000
780*9356374aSAndroid Build Coastguard Worker // - ret_man = 0x002A5A058FC295ED
781*9356374aSAndroid Build Coastguard Worker // Likewise, when parsing "20040229.0" for single precision:
782*9356374aSAndroid Build Coastguard Worker // - x = 0x4C72894000000000_0000000000000000
783*9356374aSAndroid Build Coastguard Worker // - ret_man = 0x000000000131CA25
784*9356374aSAndroid Build Coastguard Worker if ((Uint128Low64(x) == 0) && ((Uint128High64(x) & high64_mask) == 0) &&
785*9356374aSAndroid Build Coastguard Worker ((ret_man & 3) == 1)) {
786*9356374aSAndroid Build Coastguard Worker return false;
787*9356374aSAndroid Build Coastguard Worker }
788*9356374aSAndroid Build Coastguard Worker
789*9356374aSAndroid Build Coastguard Worker // (+) From 54 to 53 Bits (or for single precision, from 25 to 24 bits).
790*9356374aSAndroid Build Coastguard Worker ret_man += ret_man & 1; // Line From54a.
791*9356374aSAndroid Build Coastguard Worker ret_man >>= 1; // Line From54b.
792*9356374aSAndroid Build Coastguard Worker // Incrementing ret_man (at line From54a) may have overflowed 54 bits (53
793*9356374aSAndroid Build Coastguard Worker // bits after the right shift by 1 at line From54b), so adjust for that.
794*9356374aSAndroid Build Coastguard Worker //
795*9356374aSAndroid Build Coastguard Worker // For example, parsing "9223372036854775807" will take the if-true branch
796*9356374aSAndroid Build Coastguard Worker // here (for double precision), since:
797*9356374aSAndroid Build Coastguard Worker // - ret_man = 0x0020000000000000 = (1 << 53)
798*9356374aSAndroid Build Coastguard Worker // Likewise, when parsing "2147483647.0" for single precision:
799*9356374aSAndroid Build Coastguard Worker // - ret_man = 0x0000000001000000 = (1 << 24)
800*9356374aSAndroid Build Coastguard Worker if ((ret_man >> FloatTraits<FloatType>::kTargetMantissaBits) > 0) {
801*9356374aSAndroid Build Coastguard Worker ret_exp2 += 1;
802*9356374aSAndroid Build Coastguard Worker // Conceptually, we need a "ret_man >>= 1" in this if-block to balance
803*9356374aSAndroid Build Coastguard Worker // incrementing ret_exp2 in the line immediately above. However, we only
804*9356374aSAndroid Build Coastguard Worker // get here when line From54a overflowed (after adding a 1), so ret_man
805*9356374aSAndroid Build Coastguard Worker // here is (1 << 53). Its low 53 bits are therefore all zeroes. The only
806*9356374aSAndroid Build Coastguard Worker // remaining use of ret_man is to mask it with ((1 << 52) - 1), so only its
807*9356374aSAndroid Build Coastguard Worker // low 52 bits matter. A "ret_man >>= 1" would have no effect in practice.
808*9356374aSAndroid Build Coastguard Worker //
809*9356374aSAndroid Build Coastguard Worker // We omit the "ret_man >>= 1", even if it is cheap (and this if-branch is
810*9356374aSAndroid Build Coastguard Worker // rarely taken) and technically 'more correct', so that mutation tests
811*9356374aSAndroid Build Coastguard Worker // that would otherwise modify or omit that "ret_man >>= 1" don't complain
812*9356374aSAndroid Build Coastguard Worker // that such code mutations have no observable effect.
813*9356374aSAndroid Build Coastguard Worker }
814*9356374aSAndroid Build Coastguard Worker
815*9356374aSAndroid Build Coastguard Worker // ret_exp2 is a uint64_t. Zero or underflow means that we're in subnormal
816*9356374aSAndroid Build Coastguard Worker // space. max_exp2 (0x7FF for double precision, 0xFF for single precision) or
817*9356374aSAndroid Build Coastguard Worker // above means that we're in Inf/NaN space.
818*9356374aSAndroid Build Coastguard Worker //
819*9356374aSAndroid Build Coastguard Worker // The if block is equivalent to (but has fewer branches than):
820*9356374aSAndroid Build Coastguard Worker // if ((ret_exp2 <= 0) || (ret_exp2 >= max_exp2)) { etc }
821*9356374aSAndroid Build Coastguard Worker //
822*9356374aSAndroid Build Coastguard Worker // For example, parsing "4.9406564584124654e-324" will take the if-true
823*9356374aSAndroid Build Coastguard Worker // branch here, since ret_exp2 = -51.
824*9356374aSAndroid Build Coastguard Worker static constexpr uint64_t max_exp2 =
825*9356374aSAndroid Build Coastguard Worker (1 << FloatTraits<FloatType>::kTargetExponentBits) - 1;
826*9356374aSAndroid Build Coastguard Worker if ((ret_exp2 - 1) >= (max_exp2 - 1)) {
827*9356374aSAndroid Build Coastguard Worker return false;
828*9356374aSAndroid Build Coastguard Worker }
829*9356374aSAndroid Build Coastguard Worker
830*9356374aSAndroid Build Coastguard Worker #ifndef ABSL_BIT_PACK_FLOATS
831*9356374aSAndroid Build Coastguard Worker if (FloatTraits<FloatType>::kTargetBits == 64) {
832*9356374aSAndroid Build Coastguard Worker *value = FloatTraits<FloatType>::Make(
833*9356374aSAndroid Build Coastguard Worker (ret_man & 0x000FFFFFFFFFFFFFu) | 0x0010000000000000u,
834*9356374aSAndroid Build Coastguard Worker static_cast<int>(ret_exp2) - 1023 - 52, negative);
835*9356374aSAndroid Build Coastguard Worker return true;
836*9356374aSAndroid Build Coastguard Worker } else if (FloatTraits<FloatType>::kTargetBits == 32) {
837*9356374aSAndroid Build Coastguard Worker *value = FloatTraits<FloatType>::Make(
838*9356374aSAndroid Build Coastguard Worker (static_cast<uint32_t>(ret_man) & 0x007FFFFFu) | 0x00800000u,
839*9356374aSAndroid Build Coastguard Worker static_cast<int>(ret_exp2) - 127 - 23, negative);
840*9356374aSAndroid Build Coastguard Worker return true;
841*9356374aSAndroid Build Coastguard Worker }
842*9356374aSAndroid Build Coastguard Worker #else
843*9356374aSAndroid Build Coastguard Worker if (FloatTraits<FloatType>::kTargetBits == 64) {
844*9356374aSAndroid Build Coastguard Worker uint64_t ret_bits = (ret_exp2 << 52) | (ret_man & 0x000FFFFFFFFFFFFFu);
845*9356374aSAndroid Build Coastguard Worker if (negative) {
846*9356374aSAndroid Build Coastguard Worker ret_bits |= 0x8000000000000000u;
847*9356374aSAndroid Build Coastguard Worker }
848*9356374aSAndroid Build Coastguard Worker *value = absl::bit_cast<double>(ret_bits);
849*9356374aSAndroid Build Coastguard Worker return true;
850*9356374aSAndroid Build Coastguard Worker } else if (FloatTraits<FloatType>::kTargetBits == 32) {
851*9356374aSAndroid Build Coastguard Worker uint32_t ret_bits = (static_cast<uint32_t>(ret_exp2) << 23) |
852*9356374aSAndroid Build Coastguard Worker (static_cast<uint32_t>(ret_man) & 0x007FFFFFu);
853*9356374aSAndroid Build Coastguard Worker if (negative) {
854*9356374aSAndroid Build Coastguard Worker ret_bits |= 0x80000000u;
855*9356374aSAndroid Build Coastguard Worker }
856*9356374aSAndroid Build Coastguard Worker *value = absl::bit_cast<float>(ret_bits);
857*9356374aSAndroid Build Coastguard Worker return true;
858*9356374aSAndroid Build Coastguard Worker }
859*9356374aSAndroid Build Coastguard Worker #endif // ABSL_BIT_PACK_FLOATS
860*9356374aSAndroid Build Coastguard Worker return false;
861*9356374aSAndroid Build Coastguard Worker }
862*9356374aSAndroid Build Coastguard Worker
863*9356374aSAndroid Build Coastguard Worker template <typename FloatType>
FromCharsImpl(absl::Nonnull<const char * > first,absl::Nonnull<const char * > last,FloatType & value,chars_format fmt_flags)864*9356374aSAndroid Build Coastguard Worker from_chars_result FromCharsImpl(absl::Nonnull<const char*> first,
865*9356374aSAndroid Build Coastguard Worker absl::Nonnull<const char*> last,
866*9356374aSAndroid Build Coastguard Worker FloatType& value, chars_format fmt_flags) {
867*9356374aSAndroid Build Coastguard Worker from_chars_result result;
868*9356374aSAndroid Build Coastguard Worker result.ptr = first; // overwritten on successful parse
869*9356374aSAndroid Build Coastguard Worker result.ec = std::errc();
870*9356374aSAndroid Build Coastguard Worker
871*9356374aSAndroid Build Coastguard Worker bool negative = false;
872*9356374aSAndroid Build Coastguard Worker if (first != last && *first == '-') {
873*9356374aSAndroid Build Coastguard Worker ++first;
874*9356374aSAndroid Build Coastguard Worker negative = true;
875*9356374aSAndroid Build Coastguard Worker }
876*9356374aSAndroid Build Coastguard Worker // If the `hex` flag is *not* set, then we will accept a 0x prefix and try
877*9356374aSAndroid Build Coastguard Worker // to parse a hexadecimal float.
878*9356374aSAndroid Build Coastguard Worker if ((fmt_flags & chars_format::hex) == chars_format{} && last - first >= 2 &&
879*9356374aSAndroid Build Coastguard Worker *first == '0' && (first[1] == 'x' || first[1] == 'X')) {
880*9356374aSAndroid Build Coastguard Worker const char* hex_first = first + 2;
881*9356374aSAndroid Build Coastguard Worker strings_internal::ParsedFloat hex_parse =
882*9356374aSAndroid Build Coastguard Worker strings_internal::ParseFloat<16>(hex_first, last, fmt_flags);
883*9356374aSAndroid Build Coastguard Worker if (hex_parse.end == nullptr ||
884*9356374aSAndroid Build Coastguard Worker hex_parse.type != strings_internal::FloatType::kNumber) {
885*9356374aSAndroid Build Coastguard Worker // Either we failed to parse a hex float after the "0x", or we read
886*9356374aSAndroid Build Coastguard Worker // "0xinf" or "0xnan" which we don't want to match.
887*9356374aSAndroid Build Coastguard Worker //
888*9356374aSAndroid Build Coastguard Worker // However, a string that begins with "0x" also begins with "0", which
889*9356374aSAndroid Build Coastguard Worker // is normally a valid match for the number zero. So we want these
890*9356374aSAndroid Build Coastguard Worker // strings to match zero unless fmt_flags is `scientific`. (This flag
891*9356374aSAndroid Build Coastguard Worker // means an exponent is required, which the string "0" does not have.)
892*9356374aSAndroid Build Coastguard Worker if (fmt_flags == chars_format::scientific) {
893*9356374aSAndroid Build Coastguard Worker result.ec = std::errc::invalid_argument;
894*9356374aSAndroid Build Coastguard Worker } else {
895*9356374aSAndroid Build Coastguard Worker result.ptr = first + 1;
896*9356374aSAndroid Build Coastguard Worker value = negative ? -0.0 : 0.0;
897*9356374aSAndroid Build Coastguard Worker }
898*9356374aSAndroid Build Coastguard Worker return result;
899*9356374aSAndroid Build Coastguard Worker }
900*9356374aSAndroid Build Coastguard Worker // We matched a value.
901*9356374aSAndroid Build Coastguard Worker result.ptr = hex_parse.end;
902*9356374aSAndroid Build Coastguard Worker if (HandleEdgeCase(hex_parse, negative, &value)) {
903*9356374aSAndroid Build Coastguard Worker return result;
904*9356374aSAndroid Build Coastguard Worker }
905*9356374aSAndroid Build Coastguard Worker CalculatedFloat calculated =
906*9356374aSAndroid Build Coastguard Worker CalculateFromParsedHexadecimal<FloatType>(hex_parse);
907*9356374aSAndroid Build Coastguard Worker EncodeResult(calculated, negative, &result, &value);
908*9356374aSAndroid Build Coastguard Worker return result;
909*9356374aSAndroid Build Coastguard Worker }
910*9356374aSAndroid Build Coastguard Worker // Otherwise, we choose the number base based on the flags.
911*9356374aSAndroid Build Coastguard Worker if ((fmt_flags & chars_format::hex) == chars_format::hex) {
912*9356374aSAndroid Build Coastguard Worker strings_internal::ParsedFloat hex_parse =
913*9356374aSAndroid Build Coastguard Worker strings_internal::ParseFloat<16>(first, last, fmt_flags);
914*9356374aSAndroid Build Coastguard Worker if (hex_parse.end == nullptr) {
915*9356374aSAndroid Build Coastguard Worker result.ec = std::errc::invalid_argument;
916*9356374aSAndroid Build Coastguard Worker return result;
917*9356374aSAndroid Build Coastguard Worker }
918*9356374aSAndroid Build Coastguard Worker result.ptr = hex_parse.end;
919*9356374aSAndroid Build Coastguard Worker if (HandleEdgeCase(hex_parse, negative, &value)) {
920*9356374aSAndroid Build Coastguard Worker return result;
921*9356374aSAndroid Build Coastguard Worker }
922*9356374aSAndroid Build Coastguard Worker CalculatedFloat calculated =
923*9356374aSAndroid Build Coastguard Worker CalculateFromParsedHexadecimal<FloatType>(hex_parse);
924*9356374aSAndroid Build Coastguard Worker EncodeResult(calculated, negative, &result, &value);
925*9356374aSAndroid Build Coastguard Worker return result;
926*9356374aSAndroid Build Coastguard Worker } else {
927*9356374aSAndroid Build Coastguard Worker strings_internal::ParsedFloat decimal_parse =
928*9356374aSAndroid Build Coastguard Worker strings_internal::ParseFloat<10>(first, last, fmt_flags);
929*9356374aSAndroid Build Coastguard Worker if (decimal_parse.end == nullptr) {
930*9356374aSAndroid Build Coastguard Worker result.ec = std::errc::invalid_argument;
931*9356374aSAndroid Build Coastguard Worker return result;
932*9356374aSAndroid Build Coastguard Worker }
933*9356374aSAndroid Build Coastguard Worker result.ptr = decimal_parse.end;
934*9356374aSAndroid Build Coastguard Worker if (HandleEdgeCase(decimal_parse, negative, &value)) {
935*9356374aSAndroid Build Coastguard Worker return result;
936*9356374aSAndroid Build Coastguard Worker }
937*9356374aSAndroid Build Coastguard Worker // A nullptr subrange_begin means that the decimal_parse.mantissa is exact
938*9356374aSAndroid Build Coastguard Worker // (not truncated), a precondition of the Eisel-Lemire algorithm.
939*9356374aSAndroid Build Coastguard Worker if ((decimal_parse.subrange_begin == nullptr) &&
940*9356374aSAndroid Build Coastguard Worker EiselLemire<FloatType>(decimal_parse, negative, &value, &result.ec)) {
941*9356374aSAndroid Build Coastguard Worker return result;
942*9356374aSAndroid Build Coastguard Worker }
943*9356374aSAndroid Build Coastguard Worker CalculatedFloat calculated =
944*9356374aSAndroid Build Coastguard Worker CalculateFromParsedDecimal<FloatType>(decimal_parse);
945*9356374aSAndroid Build Coastguard Worker EncodeResult(calculated, negative, &result, &value);
946*9356374aSAndroid Build Coastguard Worker return result;
947*9356374aSAndroid Build Coastguard Worker }
948*9356374aSAndroid Build Coastguard Worker }
949*9356374aSAndroid Build Coastguard Worker } // namespace
950*9356374aSAndroid Build Coastguard Worker
from_chars(absl::Nonnull<const char * > first,absl::Nonnull<const char * > last,double & value,chars_format fmt)951*9356374aSAndroid Build Coastguard Worker from_chars_result from_chars(absl::Nonnull<const char*> first,
952*9356374aSAndroid Build Coastguard Worker absl::Nonnull<const char*> last, double& value,
953*9356374aSAndroid Build Coastguard Worker chars_format fmt) {
954*9356374aSAndroid Build Coastguard Worker return FromCharsImpl(first, last, value, fmt);
955*9356374aSAndroid Build Coastguard Worker }
956*9356374aSAndroid Build Coastguard Worker
from_chars(absl::Nonnull<const char * > first,absl::Nonnull<const char * > last,float & value,chars_format fmt)957*9356374aSAndroid Build Coastguard Worker from_chars_result from_chars(absl::Nonnull<const char*> first,
958*9356374aSAndroid Build Coastguard Worker absl::Nonnull<const char*> last, float& value,
959*9356374aSAndroid Build Coastguard Worker chars_format fmt) {
960*9356374aSAndroid Build Coastguard Worker return FromCharsImpl(first, last, value, fmt);
961*9356374aSAndroid Build Coastguard Worker }
962*9356374aSAndroid Build Coastguard Worker
963*9356374aSAndroid Build Coastguard Worker namespace {
964*9356374aSAndroid Build Coastguard Worker
965*9356374aSAndroid Build Coastguard Worker // Table of powers of 10, from kPower10TableMinInclusive to
966*9356374aSAndroid Build Coastguard Worker // kPower10TableMaxExclusive.
967*9356374aSAndroid Build Coastguard Worker //
968*9356374aSAndroid Build Coastguard Worker // kPower10MantissaHighTable[i - kPower10TableMinInclusive] stores the 64-bit
969*9356374aSAndroid Build Coastguard Worker // mantissa. The high bit is always on.
970*9356374aSAndroid Build Coastguard Worker //
971*9356374aSAndroid Build Coastguard Worker // kPower10MantissaLowTable extends that 64-bit mantissa to 128 bits.
972*9356374aSAndroid Build Coastguard Worker //
973*9356374aSAndroid Build Coastguard Worker // Power10Exponent(i) calculates the power-of-two exponent.
974*9356374aSAndroid Build Coastguard Worker //
975*9356374aSAndroid Build Coastguard Worker // For a number i, this gives the unique mantissaHigh and exponent such that
976*9356374aSAndroid Build Coastguard Worker // (mantissaHigh * 2**exponent) <= 10**i < ((mantissaHigh + 1) * 2**exponent).
977*9356374aSAndroid Build Coastguard Worker //
978*9356374aSAndroid Build Coastguard Worker // For example, Python can confirm that the exact hexadecimal value of 1e60 is:
979*9356374aSAndroid Build Coastguard Worker // >>> a = 1000000000000000000000000000000000000000000000000000000000000
980*9356374aSAndroid Build Coastguard Worker // >>> hex(a)
981*9356374aSAndroid Build Coastguard Worker // '0x9f4f2726179a224501d762422c946590d91000000000000000'
982*9356374aSAndroid Build Coastguard Worker // Adding underscores at every 8th hex digit shows 50 hex digits:
983*9356374aSAndroid Build Coastguard Worker // '0x9f4f2726_179a2245_01d76242_2c946590_d9100000_00000000_00'.
984*9356374aSAndroid Build Coastguard Worker // In this case, the high bit of the first hex digit, 9, is coincidentally set,
985*9356374aSAndroid Build Coastguard Worker // so we do not have to do further shifting to deduce the 128-bit mantissa:
986*9356374aSAndroid Build Coastguard Worker // - kPower10MantissaHighTable[60 - kP10TMI] = 0x9f4f2726179a2245U
987*9356374aSAndroid Build Coastguard Worker // - kPower10MantissaLowTable[ 60 - kP10TMI] = 0x01d762422c946590U
988*9356374aSAndroid Build Coastguard Worker // where kP10TMI is kPower10TableMinInclusive. The low 18 of those 50 hex
989*9356374aSAndroid Build Coastguard Worker // digits are truncated.
990*9356374aSAndroid Build Coastguard Worker //
991*9356374aSAndroid Build Coastguard Worker // 50 hex digits (with the high bit set) is 200 bits and mantissaHigh holds 64
992*9356374aSAndroid Build Coastguard Worker // bits, so Power10Exponent(60) = 200 - 64 = 136. Again, Python can confirm:
993*9356374aSAndroid Build Coastguard Worker // >>> b = 0x9f4f2726179a2245
994*9356374aSAndroid Build Coastguard Worker // >>> ((b+0)<<136) <= a
995*9356374aSAndroid Build Coastguard Worker // True
996*9356374aSAndroid Build Coastguard Worker // >>> ((b+1)<<136) <= a
997*9356374aSAndroid Build Coastguard Worker // False
998*9356374aSAndroid Build Coastguard Worker //
999*9356374aSAndroid Build Coastguard Worker // The tables were generated by
1000*9356374aSAndroid Build Coastguard Worker // https://github.com/google/wuffs/blob/315b2e52625ebd7b02d8fac13e3cd85ea374fb80/script/print-mpb-powers-of-10.go
1001*9356374aSAndroid Build Coastguard Worker // after re-formatting its output into two arrays of N uint64_t values (instead
1002*9356374aSAndroid Build Coastguard Worker // of an N element array of uint64_t pairs).
1003*9356374aSAndroid Build Coastguard Worker
1004*9356374aSAndroid Build Coastguard Worker const uint64_t kPower10MantissaHighTable[] = {
1005*9356374aSAndroid Build Coastguard Worker 0xeef453d6923bd65aU, 0x9558b4661b6565f8U, 0xbaaee17fa23ebf76U,
1006*9356374aSAndroid Build Coastguard Worker 0xe95a99df8ace6f53U, 0x91d8a02bb6c10594U, 0xb64ec836a47146f9U,
1007*9356374aSAndroid Build Coastguard Worker 0xe3e27a444d8d98b7U, 0x8e6d8c6ab0787f72U, 0xb208ef855c969f4fU,
1008*9356374aSAndroid Build Coastguard Worker 0xde8b2b66b3bc4723U, 0x8b16fb203055ac76U, 0xaddcb9e83c6b1793U,
1009*9356374aSAndroid Build Coastguard Worker 0xd953e8624b85dd78U, 0x87d4713d6f33aa6bU, 0xa9c98d8ccb009506U,
1010*9356374aSAndroid Build Coastguard Worker 0xd43bf0effdc0ba48U, 0x84a57695fe98746dU, 0xa5ced43b7e3e9188U,
1011*9356374aSAndroid Build Coastguard Worker 0xcf42894a5dce35eaU, 0x818995ce7aa0e1b2U, 0xa1ebfb4219491a1fU,
1012*9356374aSAndroid Build Coastguard Worker 0xca66fa129f9b60a6U, 0xfd00b897478238d0U, 0x9e20735e8cb16382U,
1013*9356374aSAndroid Build Coastguard Worker 0xc5a890362fddbc62U, 0xf712b443bbd52b7bU, 0x9a6bb0aa55653b2dU,
1014*9356374aSAndroid Build Coastguard Worker 0xc1069cd4eabe89f8U, 0xf148440a256e2c76U, 0x96cd2a865764dbcaU,
1015*9356374aSAndroid Build Coastguard Worker 0xbc807527ed3e12bcU, 0xeba09271e88d976bU, 0x93445b8731587ea3U,
1016*9356374aSAndroid Build Coastguard Worker 0xb8157268fdae9e4cU, 0xe61acf033d1a45dfU, 0x8fd0c16206306babU,
1017*9356374aSAndroid Build Coastguard Worker 0xb3c4f1ba87bc8696U, 0xe0b62e2929aba83cU, 0x8c71dcd9ba0b4925U,
1018*9356374aSAndroid Build Coastguard Worker 0xaf8e5410288e1b6fU, 0xdb71e91432b1a24aU, 0x892731ac9faf056eU,
1019*9356374aSAndroid Build Coastguard Worker 0xab70fe17c79ac6caU, 0xd64d3d9db981787dU, 0x85f0468293f0eb4eU,
1020*9356374aSAndroid Build Coastguard Worker 0xa76c582338ed2621U, 0xd1476e2c07286faaU, 0x82cca4db847945caU,
1021*9356374aSAndroid Build Coastguard Worker 0xa37fce126597973cU, 0xcc5fc196fefd7d0cU, 0xff77b1fcbebcdc4fU,
1022*9356374aSAndroid Build Coastguard Worker 0x9faacf3df73609b1U, 0xc795830d75038c1dU, 0xf97ae3d0d2446f25U,
1023*9356374aSAndroid Build Coastguard Worker 0x9becce62836ac577U, 0xc2e801fb244576d5U, 0xf3a20279ed56d48aU,
1024*9356374aSAndroid Build Coastguard Worker 0x9845418c345644d6U, 0xbe5691ef416bd60cU, 0xedec366b11c6cb8fU,
1025*9356374aSAndroid Build Coastguard Worker 0x94b3a202eb1c3f39U, 0xb9e08a83a5e34f07U, 0xe858ad248f5c22c9U,
1026*9356374aSAndroid Build Coastguard Worker 0x91376c36d99995beU, 0xb58547448ffffb2dU, 0xe2e69915b3fff9f9U,
1027*9356374aSAndroid Build Coastguard Worker 0x8dd01fad907ffc3bU, 0xb1442798f49ffb4aU, 0xdd95317f31c7fa1dU,
1028*9356374aSAndroid Build Coastguard Worker 0x8a7d3eef7f1cfc52U, 0xad1c8eab5ee43b66U, 0xd863b256369d4a40U,
1029*9356374aSAndroid Build Coastguard Worker 0x873e4f75e2224e68U, 0xa90de3535aaae202U, 0xd3515c2831559a83U,
1030*9356374aSAndroid Build Coastguard Worker 0x8412d9991ed58091U, 0xa5178fff668ae0b6U, 0xce5d73ff402d98e3U,
1031*9356374aSAndroid Build Coastguard Worker 0x80fa687f881c7f8eU, 0xa139029f6a239f72U, 0xc987434744ac874eU,
1032*9356374aSAndroid Build Coastguard Worker 0xfbe9141915d7a922U, 0x9d71ac8fada6c9b5U, 0xc4ce17b399107c22U,
1033*9356374aSAndroid Build Coastguard Worker 0xf6019da07f549b2bU, 0x99c102844f94e0fbU, 0xc0314325637a1939U,
1034*9356374aSAndroid Build Coastguard Worker 0xf03d93eebc589f88U, 0x96267c7535b763b5U, 0xbbb01b9283253ca2U,
1035*9356374aSAndroid Build Coastguard Worker 0xea9c227723ee8bcbU, 0x92a1958a7675175fU, 0xb749faed14125d36U,
1036*9356374aSAndroid Build Coastguard Worker 0xe51c79a85916f484U, 0x8f31cc0937ae58d2U, 0xb2fe3f0b8599ef07U,
1037*9356374aSAndroid Build Coastguard Worker 0xdfbdcece67006ac9U, 0x8bd6a141006042bdU, 0xaecc49914078536dU,
1038*9356374aSAndroid Build Coastguard Worker 0xda7f5bf590966848U, 0x888f99797a5e012dU, 0xaab37fd7d8f58178U,
1039*9356374aSAndroid Build Coastguard Worker 0xd5605fcdcf32e1d6U, 0x855c3be0a17fcd26U, 0xa6b34ad8c9dfc06fU,
1040*9356374aSAndroid Build Coastguard Worker 0xd0601d8efc57b08bU, 0x823c12795db6ce57U, 0xa2cb1717b52481edU,
1041*9356374aSAndroid Build Coastguard Worker 0xcb7ddcdda26da268U, 0xfe5d54150b090b02U, 0x9efa548d26e5a6e1U,
1042*9356374aSAndroid Build Coastguard Worker 0xc6b8e9b0709f109aU, 0xf867241c8cc6d4c0U, 0x9b407691d7fc44f8U,
1043*9356374aSAndroid Build Coastguard Worker 0xc21094364dfb5636U, 0xf294b943e17a2bc4U, 0x979cf3ca6cec5b5aU,
1044*9356374aSAndroid Build Coastguard Worker 0xbd8430bd08277231U, 0xece53cec4a314ebdU, 0x940f4613ae5ed136U,
1045*9356374aSAndroid Build Coastguard Worker 0xb913179899f68584U, 0xe757dd7ec07426e5U, 0x9096ea6f3848984fU,
1046*9356374aSAndroid Build Coastguard Worker 0xb4bca50b065abe63U, 0xe1ebce4dc7f16dfbU, 0x8d3360f09cf6e4bdU,
1047*9356374aSAndroid Build Coastguard Worker 0xb080392cc4349decU, 0xdca04777f541c567U, 0x89e42caaf9491b60U,
1048*9356374aSAndroid Build Coastguard Worker 0xac5d37d5b79b6239U, 0xd77485cb25823ac7U, 0x86a8d39ef77164bcU,
1049*9356374aSAndroid Build Coastguard Worker 0xa8530886b54dbdebU, 0xd267caa862a12d66U, 0x8380dea93da4bc60U,
1050*9356374aSAndroid Build Coastguard Worker 0xa46116538d0deb78U, 0xcd795be870516656U, 0x806bd9714632dff6U,
1051*9356374aSAndroid Build Coastguard Worker 0xa086cfcd97bf97f3U, 0xc8a883c0fdaf7df0U, 0xfad2a4b13d1b5d6cU,
1052*9356374aSAndroid Build Coastguard Worker 0x9cc3a6eec6311a63U, 0xc3f490aa77bd60fcU, 0xf4f1b4d515acb93bU,
1053*9356374aSAndroid Build Coastguard Worker 0x991711052d8bf3c5U, 0xbf5cd54678eef0b6U, 0xef340a98172aace4U,
1054*9356374aSAndroid Build Coastguard Worker 0x9580869f0e7aac0eU, 0xbae0a846d2195712U, 0xe998d258869facd7U,
1055*9356374aSAndroid Build Coastguard Worker 0x91ff83775423cc06U, 0xb67f6455292cbf08U, 0xe41f3d6a7377eecaU,
1056*9356374aSAndroid Build Coastguard Worker 0x8e938662882af53eU, 0xb23867fb2a35b28dU, 0xdec681f9f4c31f31U,
1057*9356374aSAndroid Build Coastguard Worker 0x8b3c113c38f9f37eU, 0xae0b158b4738705eU, 0xd98ddaee19068c76U,
1058*9356374aSAndroid Build Coastguard Worker 0x87f8a8d4cfa417c9U, 0xa9f6d30a038d1dbcU, 0xd47487cc8470652bU,
1059*9356374aSAndroid Build Coastguard Worker 0x84c8d4dfd2c63f3bU, 0xa5fb0a17c777cf09U, 0xcf79cc9db955c2ccU,
1060*9356374aSAndroid Build Coastguard Worker 0x81ac1fe293d599bfU, 0xa21727db38cb002fU, 0xca9cf1d206fdc03bU,
1061*9356374aSAndroid Build Coastguard Worker 0xfd442e4688bd304aU, 0x9e4a9cec15763e2eU, 0xc5dd44271ad3cdbaU,
1062*9356374aSAndroid Build Coastguard Worker 0xf7549530e188c128U, 0x9a94dd3e8cf578b9U, 0xc13a148e3032d6e7U,
1063*9356374aSAndroid Build Coastguard Worker 0xf18899b1bc3f8ca1U, 0x96f5600f15a7b7e5U, 0xbcb2b812db11a5deU,
1064*9356374aSAndroid Build Coastguard Worker 0xebdf661791d60f56U, 0x936b9fcebb25c995U, 0xb84687c269ef3bfbU,
1065*9356374aSAndroid Build Coastguard Worker 0xe65829b3046b0afaU, 0x8ff71a0fe2c2e6dcU, 0xb3f4e093db73a093U,
1066*9356374aSAndroid Build Coastguard Worker 0xe0f218b8d25088b8U, 0x8c974f7383725573U, 0xafbd2350644eeacfU,
1067*9356374aSAndroid Build Coastguard Worker 0xdbac6c247d62a583U, 0x894bc396ce5da772U, 0xab9eb47c81f5114fU,
1068*9356374aSAndroid Build Coastguard Worker 0xd686619ba27255a2U, 0x8613fd0145877585U, 0xa798fc4196e952e7U,
1069*9356374aSAndroid Build Coastguard Worker 0xd17f3b51fca3a7a0U, 0x82ef85133de648c4U, 0xa3ab66580d5fdaf5U,
1070*9356374aSAndroid Build Coastguard Worker 0xcc963fee10b7d1b3U, 0xffbbcfe994e5c61fU, 0x9fd561f1fd0f9bd3U,
1071*9356374aSAndroid Build Coastguard Worker 0xc7caba6e7c5382c8U, 0xf9bd690a1b68637bU, 0x9c1661a651213e2dU,
1072*9356374aSAndroid Build Coastguard Worker 0xc31bfa0fe5698db8U, 0xf3e2f893dec3f126U, 0x986ddb5c6b3a76b7U,
1073*9356374aSAndroid Build Coastguard Worker 0xbe89523386091465U, 0xee2ba6c0678b597fU, 0x94db483840b717efU,
1074*9356374aSAndroid Build Coastguard Worker 0xba121a4650e4ddebU, 0xe896a0d7e51e1566U, 0x915e2486ef32cd60U,
1075*9356374aSAndroid Build Coastguard Worker 0xb5b5ada8aaff80b8U, 0xe3231912d5bf60e6U, 0x8df5efabc5979c8fU,
1076*9356374aSAndroid Build Coastguard Worker 0xb1736b96b6fd83b3U, 0xddd0467c64bce4a0U, 0x8aa22c0dbef60ee4U,
1077*9356374aSAndroid Build Coastguard Worker 0xad4ab7112eb3929dU, 0xd89d64d57a607744U, 0x87625f056c7c4a8bU,
1078*9356374aSAndroid Build Coastguard Worker 0xa93af6c6c79b5d2dU, 0xd389b47879823479U, 0x843610cb4bf160cbU,
1079*9356374aSAndroid Build Coastguard Worker 0xa54394fe1eedb8feU, 0xce947a3da6a9273eU, 0x811ccc668829b887U,
1080*9356374aSAndroid Build Coastguard Worker 0xa163ff802a3426a8U, 0xc9bcff6034c13052U, 0xfc2c3f3841f17c67U,
1081*9356374aSAndroid Build Coastguard Worker 0x9d9ba7832936edc0U, 0xc5029163f384a931U, 0xf64335bcf065d37dU,
1082*9356374aSAndroid Build Coastguard Worker 0x99ea0196163fa42eU, 0xc06481fb9bcf8d39U, 0xf07da27a82c37088U,
1083*9356374aSAndroid Build Coastguard Worker 0x964e858c91ba2655U, 0xbbe226efb628afeaU, 0xeadab0aba3b2dbe5U,
1084*9356374aSAndroid Build Coastguard Worker 0x92c8ae6b464fc96fU, 0xb77ada0617e3bbcbU, 0xe55990879ddcaabdU,
1085*9356374aSAndroid Build Coastguard Worker 0x8f57fa54c2a9eab6U, 0xb32df8e9f3546564U, 0xdff9772470297ebdU,
1086*9356374aSAndroid Build Coastguard Worker 0x8bfbea76c619ef36U, 0xaefae51477a06b03U, 0xdab99e59958885c4U,
1087*9356374aSAndroid Build Coastguard Worker 0x88b402f7fd75539bU, 0xaae103b5fcd2a881U, 0xd59944a37c0752a2U,
1088*9356374aSAndroid Build Coastguard Worker 0x857fcae62d8493a5U, 0xa6dfbd9fb8e5b88eU, 0xd097ad07a71f26b2U,
1089*9356374aSAndroid Build Coastguard Worker 0x825ecc24c873782fU, 0xa2f67f2dfa90563bU, 0xcbb41ef979346bcaU,
1090*9356374aSAndroid Build Coastguard Worker 0xfea126b7d78186bcU, 0x9f24b832e6b0f436U, 0xc6ede63fa05d3143U,
1091*9356374aSAndroid Build Coastguard Worker 0xf8a95fcf88747d94U, 0x9b69dbe1b548ce7cU, 0xc24452da229b021bU,
1092*9356374aSAndroid Build Coastguard Worker 0xf2d56790ab41c2a2U, 0x97c560ba6b0919a5U, 0xbdb6b8e905cb600fU,
1093*9356374aSAndroid Build Coastguard Worker 0xed246723473e3813U, 0x9436c0760c86e30bU, 0xb94470938fa89bceU,
1094*9356374aSAndroid Build Coastguard Worker 0xe7958cb87392c2c2U, 0x90bd77f3483bb9b9U, 0xb4ecd5f01a4aa828U,
1095*9356374aSAndroid Build Coastguard Worker 0xe2280b6c20dd5232U, 0x8d590723948a535fU, 0xb0af48ec79ace837U,
1096*9356374aSAndroid Build Coastguard Worker 0xdcdb1b2798182244U, 0x8a08f0f8bf0f156bU, 0xac8b2d36eed2dac5U,
1097*9356374aSAndroid Build Coastguard Worker 0xd7adf884aa879177U, 0x86ccbb52ea94baeaU, 0xa87fea27a539e9a5U,
1098*9356374aSAndroid Build Coastguard Worker 0xd29fe4b18e88640eU, 0x83a3eeeef9153e89U, 0xa48ceaaab75a8e2bU,
1099*9356374aSAndroid Build Coastguard Worker 0xcdb02555653131b6U, 0x808e17555f3ebf11U, 0xa0b19d2ab70e6ed6U,
1100*9356374aSAndroid Build Coastguard Worker 0xc8de047564d20a8bU, 0xfb158592be068d2eU, 0x9ced737bb6c4183dU,
1101*9356374aSAndroid Build Coastguard Worker 0xc428d05aa4751e4cU, 0xf53304714d9265dfU, 0x993fe2c6d07b7fabU,
1102*9356374aSAndroid Build Coastguard Worker 0xbf8fdb78849a5f96U, 0xef73d256a5c0f77cU, 0x95a8637627989aadU,
1103*9356374aSAndroid Build Coastguard Worker 0xbb127c53b17ec159U, 0xe9d71b689dde71afU, 0x9226712162ab070dU,
1104*9356374aSAndroid Build Coastguard Worker 0xb6b00d69bb55c8d1U, 0xe45c10c42a2b3b05U, 0x8eb98a7a9a5b04e3U,
1105*9356374aSAndroid Build Coastguard Worker 0xb267ed1940f1c61cU, 0xdf01e85f912e37a3U, 0x8b61313bbabce2c6U,
1106*9356374aSAndroid Build Coastguard Worker 0xae397d8aa96c1b77U, 0xd9c7dced53c72255U, 0x881cea14545c7575U,
1107*9356374aSAndroid Build Coastguard Worker 0xaa242499697392d2U, 0xd4ad2dbfc3d07787U, 0x84ec3c97da624ab4U,
1108*9356374aSAndroid Build Coastguard Worker 0xa6274bbdd0fadd61U, 0xcfb11ead453994baU, 0x81ceb32c4b43fcf4U,
1109*9356374aSAndroid Build Coastguard Worker 0xa2425ff75e14fc31U, 0xcad2f7f5359a3b3eU, 0xfd87b5f28300ca0dU,
1110*9356374aSAndroid Build Coastguard Worker 0x9e74d1b791e07e48U, 0xc612062576589ddaU, 0xf79687aed3eec551U,
1111*9356374aSAndroid Build Coastguard Worker 0x9abe14cd44753b52U, 0xc16d9a0095928a27U, 0xf1c90080baf72cb1U,
1112*9356374aSAndroid Build Coastguard Worker 0x971da05074da7beeU, 0xbce5086492111aeaU, 0xec1e4a7db69561a5U,
1113*9356374aSAndroid Build Coastguard Worker 0x9392ee8e921d5d07U, 0xb877aa3236a4b449U, 0xe69594bec44de15bU,
1114*9356374aSAndroid Build Coastguard Worker 0x901d7cf73ab0acd9U, 0xb424dc35095cd80fU, 0xe12e13424bb40e13U,
1115*9356374aSAndroid Build Coastguard Worker 0x8cbccc096f5088cbU, 0xafebff0bcb24aafeU, 0xdbe6fecebdedd5beU,
1116*9356374aSAndroid Build Coastguard Worker 0x89705f4136b4a597U, 0xabcc77118461cefcU, 0xd6bf94d5e57a42bcU,
1117*9356374aSAndroid Build Coastguard Worker 0x8637bd05af6c69b5U, 0xa7c5ac471b478423U, 0xd1b71758e219652bU,
1118*9356374aSAndroid Build Coastguard Worker 0x83126e978d4fdf3bU, 0xa3d70a3d70a3d70aU, 0xccccccccccccccccU,
1119*9356374aSAndroid Build Coastguard Worker 0x8000000000000000U, 0xa000000000000000U, 0xc800000000000000U,
1120*9356374aSAndroid Build Coastguard Worker 0xfa00000000000000U, 0x9c40000000000000U, 0xc350000000000000U,
1121*9356374aSAndroid Build Coastguard Worker 0xf424000000000000U, 0x9896800000000000U, 0xbebc200000000000U,
1122*9356374aSAndroid Build Coastguard Worker 0xee6b280000000000U, 0x9502f90000000000U, 0xba43b74000000000U,
1123*9356374aSAndroid Build Coastguard Worker 0xe8d4a51000000000U, 0x9184e72a00000000U, 0xb5e620f480000000U,
1124*9356374aSAndroid Build Coastguard Worker 0xe35fa931a0000000U, 0x8e1bc9bf04000000U, 0xb1a2bc2ec5000000U,
1125*9356374aSAndroid Build Coastguard Worker 0xde0b6b3a76400000U, 0x8ac7230489e80000U, 0xad78ebc5ac620000U,
1126*9356374aSAndroid Build Coastguard Worker 0xd8d726b7177a8000U, 0x878678326eac9000U, 0xa968163f0a57b400U,
1127*9356374aSAndroid Build Coastguard Worker 0xd3c21bcecceda100U, 0x84595161401484a0U, 0xa56fa5b99019a5c8U,
1128*9356374aSAndroid Build Coastguard Worker 0xcecb8f27f4200f3aU, 0x813f3978f8940984U, 0xa18f07d736b90be5U,
1129*9356374aSAndroid Build Coastguard Worker 0xc9f2c9cd04674edeU, 0xfc6f7c4045812296U, 0x9dc5ada82b70b59dU,
1130*9356374aSAndroid Build Coastguard Worker 0xc5371912364ce305U, 0xf684df56c3e01bc6U, 0x9a130b963a6c115cU,
1131*9356374aSAndroid Build Coastguard Worker 0xc097ce7bc90715b3U, 0xf0bdc21abb48db20U, 0x96769950b50d88f4U,
1132*9356374aSAndroid Build Coastguard Worker 0xbc143fa4e250eb31U, 0xeb194f8e1ae525fdU, 0x92efd1b8d0cf37beU,
1133*9356374aSAndroid Build Coastguard Worker 0xb7abc627050305adU, 0xe596b7b0c643c719U, 0x8f7e32ce7bea5c6fU,
1134*9356374aSAndroid Build Coastguard Worker 0xb35dbf821ae4f38bU, 0xe0352f62a19e306eU, 0x8c213d9da502de45U,
1135*9356374aSAndroid Build Coastguard Worker 0xaf298d050e4395d6U, 0xdaf3f04651d47b4cU, 0x88d8762bf324cd0fU,
1136*9356374aSAndroid Build Coastguard Worker 0xab0e93b6efee0053U, 0xd5d238a4abe98068U, 0x85a36366eb71f041U,
1137*9356374aSAndroid Build Coastguard Worker 0xa70c3c40a64e6c51U, 0xd0cf4b50cfe20765U, 0x82818f1281ed449fU,
1138*9356374aSAndroid Build Coastguard Worker 0xa321f2d7226895c7U, 0xcbea6f8ceb02bb39U, 0xfee50b7025c36a08U,
1139*9356374aSAndroid Build Coastguard Worker 0x9f4f2726179a2245U, 0xc722f0ef9d80aad6U, 0xf8ebad2b84e0d58bU,
1140*9356374aSAndroid Build Coastguard Worker 0x9b934c3b330c8577U, 0xc2781f49ffcfa6d5U, 0xf316271c7fc3908aU,
1141*9356374aSAndroid Build Coastguard Worker 0x97edd871cfda3a56U, 0xbde94e8e43d0c8ecU, 0xed63a231d4c4fb27U,
1142*9356374aSAndroid Build Coastguard Worker 0x945e455f24fb1cf8U, 0xb975d6b6ee39e436U, 0xe7d34c64a9c85d44U,
1143*9356374aSAndroid Build Coastguard Worker 0x90e40fbeea1d3a4aU, 0xb51d13aea4a488ddU, 0xe264589a4dcdab14U,
1144*9356374aSAndroid Build Coastguard Worker 0x8d7eb76070a08aecU, 0xb0de65388cc8ada8U, 0xdd15fe86affad912U,
1145*9356374aSAndroid Build Coastguard Worker 0x8a2dbf142dfcc7abU, 0xacb92ed9397bf996U, 0xd7e77a8f87daf7fbU,
1146*9356374aSAndroid Build Coastguard Worker 0x86f0ac99b4e8dafdU, 0xa8acd7c0222311bcU, 0xd2d80db02aabd62bU,
1147*9356374aSAndroid Build Coastguard Worker 0x83c7088e1aab65dbU, 0xa4b8cab1a1563f52U, 0xcde6fd5e09abcf26U,
1148*9356374aSAndroid Build Coastguard Worker 0x80b05e5ac60b6178U, 0xa0dc75f1778e39d6U, 0xc913936dd571c84cU,
1149*9356374aSAndroid Build Coastguard Worker 0xfb5878494ace3a5fU, 0x9d174b2dcec0e47bU, 0xc45d1df942711d9aU,
1150*9356374aSAndroid Build Coastguard Worker 0xf5746577930d6500U, 0x9968bf6abbe85f20U, 0xbfc2ef456ae276e8U,
1151*9356374aSAndroid Build Coastguard Worker 0xefb3ab16c59b14a2U, 0x95d04aee3b80ece5U, 0xbb445da9ca61281fU,
1152*9356374aSAndroid Build Coastguard Worker 0xea1575143cf97226U, 0x924d692ca61be758U, 0xb6e0c377cfa2e12eU,
1153*9356374aSAndroid Build Coastguard Worker 0xe498f455c38b997aU, 0x8edf98b59a373fecU, 0xb2977ee300c50fe7U,
1154*9356374aSAndroid Build Coastguard Worker 0xdf3d5e9bc0f653e1U, 0x8b865b215899f46cU, 0xae67f1e9aec07187U,
1155*9356374aSAndroid Build Coastguard Worker 0xda01ee641a708de9U, 0x884134fe908658b2U, 0xaa51823e34a7eedeU,
1156*9356374aSAndroid Build Coastguard Worker 0xd4e5e2cdc1d1ea96U, 0x850fadc09923329eU, 0xa6539930bf6bff45U,
1157*9356374aSAndroid Build Coastguard Worker 0xcfe87f7cef46ff16U, 0x81f14fae158c5f6eU, 0xa26da3999aef7749U,
1158*9356374aSAndroid Build Coastguard Worker 0xcb090c8001ab551cU, 0xfdcb4fa002162a63U, 0x9e9f11c4014dda7eU,
1159*9356374aSAndroid Build Coastguard Worker 0xc646d63501a1511dU, 0xf7d88bc24209a565U, 0x9ae757596946075fU,
1160*9356374aSAndroid Build Coastguard Worker 0xc1a12d2fc3978937U, 0xf209787bb47d6b84U, 0x9745eb4d50ce6332U,
1161*9356374aSAndroid Build Coastguard Worker 0xbd176620a501fbffU, 0xec5d3fa8ce427affU, 0x93ba47c980e98cdfU,
1162*9356374aSAndroid Build Coastguard Worker 0xb8a8d9bbe123f017U, 0xe6d3102ad96cec1dU, 0x9043ea1ac7e41392U,
1163*9356374aSAndroid Build Coastguard Worker 0xb454e4a179dd1877U, 0xe16a1dc9d8545e94U, 0x8ce2529e2734bb1dU,
1164*9356374aSAndroid Build Coastguard Worker 0xb01ae745b101e9e4U, 0xdc21a1171d42645dU, 0x899504ae72497ebaU,
1165*9356374aSAndroid Build Coastguard Worker 0xabfa45da0edbde69U, 0xd6f8d7509292d603U, 0x865b86925b9bc5c2U,
1166*9356374aSAndroid Build Coastguard Worker 0xa7f26836f282b732U, 0xd1ef0244af2364ffU, 0x8335616aed761f1fU,
1167*9356374aSAndroid Build Coastguard Worker 0xa402b9c5a8d3a6e7U, 0xcd036837130890a1U, 0x802221226be55a64U,
1168*9356374aSAndroid Build Coastguard Worker 0xa02aa96b06deb0fdU, 0xc83553c5c8965d3dU, 0xfa42a8b73abbf48cU,
1169*9356374aSAndroid Build Coastguard Worker 0x9c69a97284b578d7U, 0xc38413cf25e2d70dU, 0xf46518c2ef5b8cd1U,
1170*9356374aSAndroid Build Coastguard Worker 0x98bf2f79d5993802U, 0xbeeefb584aff8603U, 0xeeaaba2e5dbf6784U,
1171*9356374aSAndroid Build Coastguard Worker 0x952ab45cfa97a0b2U, 0xba756174393d88dfU, 0xe912b9d1478ceb17U,
1172*9356374aSAndroid Build Coastguard Worker 0x91abb422ccb812eeU, 0xb616a12b7fe617aaU, 0xe39c49765fdf9d94U,
1173*9356374aSAndroid Build Coastguard Worker 0x8e41ade9fbebc27dU, 0xb1d219647ae6b31cU, 0xde469fbd99a05fe3U,
1174*9356374aSAndroid Build Coastguard Worker 0x8aec23d680043beeU, 0xada72ccc20054ae9U, 0xd910f7ff28069da4U,
1175*9356374aSAndroid Build Coastguard Worker 0x87aa9aff79042286U, 0xa99541bf57452b28U, 0xd3fa922f2d1675f2U,
1176*9356374aSAndroid Build Coastguard Worker 0x847c9b5d7c2e09b7U, 0xa59bc234db398c25U, 0xcf02b2c21207ef2eU,
1177*9356374aSAndroid Build Coastguard Worker 0x8161afb94b44f57dU, 0xa1ba1ba79e1632dcU, 0xca28a291859bbf93U,
1178*9356374aSAndroid Build Coastguard Worker 0xfcb2cb35e702af78U, 0x9defbf01b061adabU, 0xc56baec21c7a1916U,
1179*9356374aSAndroid Build Coastguard Worker 0xf6c69a72a3989f5bU, 0x9a3c2087a63f6399U, 0xc0cb28a98fcf3c7fU,
1180*9356374aSAndroid Build Coastguard Worker 0xf0fdf2d3f3c30b9fU, 0x969eb7c47859e743U, 0xbc4665b596706114U,
1181*9356374aSAndroid Build Coastguard Worker 0xeb57ff22fc0c7959U, 0x9316ff75dd87cbd8U, 0xb7dcbf5354e9beceU,
1182*9356374aSAndroid Build Coastguard Worker 0xe5d3ef282a242e81U, 0x8fa475791a569d10U, 0xb38d92d760ec4455U,
1183*9356374aSAndroid Build Coastguard Worker 0xe070f78d3927556aU, 0x8c469ab843b89562U, 0xaf58416654a6babbU,
1184*9356374aSAndroid Build Coastguard Worker 0xdb2e51bfe9d0696aU, 0x88fcf317f22241e2U, 0xab3c2fddeeaad25aU,
1185*9356374aSAndroid Build Coastguard Worker 0xd60b3bd56a5586f1U, 0x85c7056562757456U, 0xa738c6bebb12d16cU,
1186*9356374aSAndroid Build Coastguard Worker 0xd106f86e69d785c7U, 0x82a45b450226b39cU, 0xa34d721642b06084U,
1187*9356374aSAndroid Build Coastguard Worker 0xcc20ce9bd35c78a5U, 0xff290242c83396ceU, 0x9f79a169bd203e41U,
1188*9356374aSAndroid Build Coastguard Worker 0xc75809c42c684dd1U, 0xf92e0c3537826145U, 0x9bbcc7a142b17ccbU,
1189*9356374aSAndroid Build Coastguard Worker 0xc2abf989935ddbfeU, 0xf356f7ebf83552feU, 0x98165af37b2153deU,
1190*9356374aSAndroid Build Coastguard Worker 0xbe1bf1b059e9a8d6U, 0xeda2ee1c7064130cU, 0x9485d4d1c63e8be7U,
1191*9356374aSAndroid Build Coastguard Worker 0xb9a74a0637ce2ee1U, 0xe8111c87c5c1ba99U, 0x910ab1d4db9914a0U,
1192*9356374aSAndroid Build Coastguard Worker 0xb54d5e4a127f59c8U, 0xe2a0b5dc971f303aU, 0x8da471a9de737e24U,
1193*9356374aSAndroid Build Coastguard Worker 0xb10d8e1456105dadU, 0xdd50f1996b947518U, 0x8a5296ffe33cc92fU,
1194*9356374aSAndroid Build Coastguard Worker 0xace73cbfdc0bfb7bU, 0xd8210befd30efa5aU, 0x8714a775e3e95c78U,
1195*9356374aSAndroid Build Coastguard Worker 0xa8d9d1535ce3b396U, 0xd31045a8341ca07cU, 0x83ea2b892091e44dU,
1196*9356374aSAndroid Build Coastguard Worker 0xa4e4b66b68b65d60U, 0xce1de40642e3f4b9U, 0x80d2ae83e9ce78f3U,
1197*9356374aSAndroid Build Coastguard Worker 0xa1075a24e4421730U, 0xc94930ae1d529cfcU, 0xfb9b7cd9a4a7443cU,
1198*9356374aSAndroid Build Coastguard Worker 0x9d412e0806e88aa5U, 0xc491798a08a2ad4eU, 0xf5b5d7ec8acb58a2U,
1199*9356374aSAndroid Build Coastguard Worker 0x9991a6f3d6bf1765U, 0xbff610b0cc6edd3fU, 0xeff394dcff8a948eU,
1200*9356374aSAndroid Build Coastguard Worker 0x95f83d0a1fb69cd9U, 0xbb764c4ca7a4440fU, 0xea53df5fd18d5513U,
1201*9356374aSAndroid Build Coastguard Worker 0x92746b9be2f8552cU, 0xb7118682dbb66a77U, 0xe4d5e82392a40515U,
1202*9356374aSAndroid Build Coastguard Worker 0x8f05b1163ba6832dU, 0xb2c71d5bca9023f8U, 0xdf78e4b2bd342cf6U,
1203*9356374aSAndroid Build Coastguard Worker 0x8bab8eefb6409c1aU, 0xae9672aba3d0c320U, 0xda3c0f568cc4f3e8U,
1204*9356374aSAndroid Build Coastguard Worker 0x8865899617fb1871U, 0xaa7eebfb9df9de8dU, 0xd51ea6fa85785631U,
1205*9356374aSAndroid Build Coastguard Worker 0x8533285c936b35deU, 0xa67ff273b8460356U, 0xd01fef10a657842cU,
1206*9356374aSAndroid Build Coastguard Worker 0x8213f56a67f6b29bU, 0xa298f2c501f45f42U, 0xcb3f2f7642717713U,
1207*9356374aSAndroid Build Coastguard Worker 0xfe0efb53d30dd4d7U, 0x9ec95d1463e8a506U, 0xc67bb4597ce2ce48U,
1208*9356374aSAndroid Build Coastguard Worker 0xf81aa16fdc1b81daU, 0x9b10a4e5e9913128U, 0xc1d4ce1f63f57d72U,
1209*9356374aSAndroid Build Coastguard Worker 0xf24a01a73cf2dccfU, 0x976e41088617ca01U, 0xbd49d14aa79dbc82U,
1210*9356374aSAndroid Build Coastguard Worker 0xec9c459d51852ba2U, 0x93e1ab8252f33b45U, 0xb8da1662e7b00a17U,
1211*9356374aSAndroid Build Coastguard Worker 0xe7109bfba19c0c9dU, 0x906a617d450187e2U, 0xb484f9dc9641e9daU,
1212*9356374aSAndroid Build Coastguard Worker 0xe1a63853bbd26451U, 0x8d07e33455637eb2U, 0xb049dc016abc5e5fU,
1213*9356374aSAndroid Build Coastguard Worker 0xdc5c5301c56b75f7U, 0x89b9b3e11b6329baU, 0xac2820d9623bf429U,
1214*9356374aSAndroid Build Coastguard Worker 0xd732290fbacaf133U, 0x867f59a9d4bed6c0U, 0xa81f301449ee8c70U,
1215*9356374aSAndroid Build Coastguard Worker 0xd226fc195c6a2f8cU, 0x83585d8fd9c25db7U, 0xa42e74f3d032f525U,
1216*9356374aSAndroid Build Coastguard Worker 0xcd3a1230c43fb26fU, 0x80444b5e7aa7cf85U, 0xa0555e361951c366U,
1217*9356374aSAndroid Build Coastguard Worker 0xc86ab5c39fa63440U, 0xfa856334878fc150U, 0x9c935e00d4b9d8d2U,
1218*9356374aSAndroid Build Coastguard Worker 0xc3b8358109e84f07U, 0xf4a642e14c6262c8U, 0x98e7e9cccfbd7dbdU,
1219*9356374aSAndroid Build Coastguard Worker 0xbf21e44003acdd2cU, 0xeeea5d5004981478U, 0x95527a5202df0ccbU,
1220*9356374aSAndroid Build Coastguard Worker 0xbaa718e68396cffdU, 0xe950df20247c83fdU, 0x91d28b7416cdd27eU,
1221*9356374aSAndroid Build Coastguard Worker 0xb6472e511c81471dU, 0xe3d8f9e563a198e5U, 0x8e679c2f5e44ff8fU,
1222*9356374aSAndroid Build Coastguard Worker };
1223*9356374aSAndroid Build Coastguard Worker
1224*9356374aSAndroid Build Coastguard Worker const uint64_t kPower10MantissaLowTable[] = {
1225*9356374aSAndroid Build Coastguard Worker 0x113faa2906a13b3fU, 0x4ac7ca59a424c507U, 0x5d79bcf00d2df649U,
1226*9356374aSAndroid Build Coastguard Worker 0xf4d82c2c107973dcU, 0x79071b9b8a4be869U, 0x9748e2826cdee284U,
1227*9356374aSAndroid Build Coastguard Worker 0xfd1b1b2308169b25U, 0xfe30f0f5e50e20f7U, 0xbdbd2d335e51a935U,
1228*9356374aSAndroid Build Coastguard Worker 0xad2c788035e61382U, 0x4c3bcb5021afcc31U, 0xdf4abe242a1bbf3dU,
1229*9356374aSAndroid Build Coastguard Worker 0xd71d6dad34a2af0dU, 0x8672648c40e5ad68U, 0x680efdaf511f18c2U,
1230*9356374aSAndroid Build Coastguard Worker 0x0212bd1b2566def2U, 0x014bb630f7604b57U, 0x419ea3bd35385e2dU,
1231*9356374aSAndroid Build Coastguard Worker 0x52064cac828675b9U, 0x7343efebd1940993U, 0x1014ebe6c5f90bf8U,
1232*9356374aSAndroid Build Coastguard Worker 0xd41a26e077774ef6U, 0x8920b098955522b4U, 0x55b46e5f5d5535b0U,
1233*9356374aSAndroid Build Coastguard Worker 0xeb2189f734aa831dU, 0xa5e9ec7501d523e4U, 0x47b233c92125366eU,
1234*9356374aSAndroid Build Coastguard Worker 0x999ec0bb696e840aU, 0xc00670ea43ca250dU, 0x380406926a5e5728U,
1235*9356374aSAndroid Build Coastguard Worker 0xc605083704f5ecf2U, 0xf7864a44c633682eU, 0x7ab3ee6afbe0211dU,
1236*9356374aSAndroid Build Coastguard Worker 0x5960ea05bad82964U, 0x6fb92487298e33bdU, 0xa5d3b6d479f8e056U,
1237*9356374aSAndroid Build Coastguard Worker 0x8f48a4899877186cU, 0x331acdabfe94de87U, 0x9ff0c08b7f1d0b14U,
1238*9356374aSAndroid Build Coastguard Worker 0x07ecf0ae5ee44dd9U, 0xc9e82cd9f69d6150U, 0xbe311c083a225cd2U,
1239*9356374aSAndroid Build Coastguard Worker 0x6dbd630a48aaf406U, 0x092cbbccdad5b108U, 0x25bbf56008c58ea5U,
1240*9356374aSAndroid Build Coastguard Worker 0xaf2af2b80af6f24eU, 0x1af5af660db4aee1U, 0x50d98d9fc890ed4dU,
1241*9356374aSAndroid Build Coastguard Worker 0xe50ff107bab528a0U, 0x1e53ed49a96272c8U, 0x25e8e89c13bb0f7aU,
1242*9356374aSAndroid Build Coastguard Worker 0x77b191618c54e9acU, 0xd59df5b9ef6a2417U, 0x4b0573286b44ad1dU,
1243*9356374aSAndroid Build Coastguard Worker 0x4ee367f9430aec32U, 0x229c41f793cda73fU, 0x6b43527578c1110fU,
1244*9356374aSAndroid Build Coastguard Worker 0x830a13896b78aaa9U, 0x23cc986bc656d553U, 0x2cbfbe86b7ec8aa8U,
1245*9356374aSAndroid Build Coastguard Worker 0x7bf7d71432f3d6a9U, 0xdaf5ccd93fb0cc53U, 0xd1b3400f8f9cff68U,
1246*9356374aSAndroid Build Coastguard Worker 0x23100809b9c21fa1U, 0xabd40a0c2832a78aU, 0x16c90c8f323f516cU,
1247*9356374aSAndroid Build Coastguard Worker 0xae3da7d97f6792e3U, 0x99cd11cfdf41779cU, 0x40405643d711d583U,
1248*9356374aSAndroid Build Coastguard Worker 0x482835ea666b2572U, 0xda3243650005eecfU, 0x90bed43e40076a82U,
1249*9356374aSAndroid Build Coastguard Worker 0x5a7744a6e804a291U, 0x711515d0a205cb36U, 0x0d5a5b44ca873e03U,
1250*9356374aSAndroid Build Coastguard Worker 0xe858790afe9486c2U, 0x626e974dbe39a872U, 0xfb0a3d212dc8128fU,
1251*9356374aSAndroid Build Coastguard Worker 0x7ce66634bc9d0b99U, 0x1c1fffc1ebc44e80U, 0xa327ffb266b56220U,
1252*9356374aSAndroid Build Coastguard Worker 0x4bf1ff9f0062baa8U, 0x6f773fc3603db4a9U, 0xcb550fb4384d21d3U,
1253*9356374aSAndroid Build Coastguard Worker 0x7e2a53a146606a48U, 0x2eda7444cbfc426dU, 0xfa911155fefb5308U,
1254*9356374aSAndroid Build Coastguard Worker 0x793555ab7eba27caU, 0x4bc1558b2f3458deU, 0x9eb1aaedfb016f16U,
1255*9356374aSAndroid Build Coastguard Worker 0x465e15a979c1cadcU, 0x0bfacd89ec191ec9U, 0xcef980ec671f667bU,
1256*9356374aSAndroid Build Coastguard Worker 0x82b7e12780e7401aU, 0xd1b2ecb8b0908810U, 0x861fa7e6dcb4aa15U,
1257*9356374aSAndroid Build Coastguard Worker 0x67a791e093e1d49aU, 0xe0c8bb2c5c6d24e0U, 0x58fae9f773886e18U,
1258*9356374aSAndroid Build Coastguard Worker 0xaf39a475506a899eU, 0x6d8406c952429603U, 0xc8e5087ba6d33b83U,
1259*9356374aSAndroid Build Coastguard Worker 0xfb1e4a9a90880a64U, 0x5cf2eea09a55067fU, 0xf42faa48c0ea481eU,
1260*9356374aSAndroid Build Coastguard Worker 0xf13b94daf124da26U, 0x76c53d08d6b70858U, 0x54768c4b0c64ca6eU,
1261*9356374aSAndroid Build Coastguard Worker 0xa9942f5dcf7dfd09U, 0xd3f93b35435d7c4cU, 0xc47bc5014a1a6dafU,
1262*9356374aSAndroid Build Coastguard Worker 0x359ab6419ca1091bU, 0xc30163d203c94b62U, 0x79e0de63425dcf1dU,
1263*9356374aSAndroid Build Coastguard Worker 0x985915fc12f542e4U, 0x3e6f5b7b17b2939dU, 0xa705992ceecf9c42U,
1264*9356374aSAndroid Build Coastguard Worker 0x50c6ff782a838353U, 0xa4f8bf5635246428U, 0x871b7795e136be99U,
1265*9356374aSAndroid Build Coastguard Worker 0x28e2557b59846e3fU, 0x331aeada2fe589cfU, 0x3ff0d2c85def7621U,
1266*9356374aSAndroid Build Coastguard Worker 0x0fed077a756b53a9U, 0xd3e8495912c62894U, 0x64712dd7abbbd95cU,
1267*9356374aSAndroid Build Coastguard Worker 0xbd8d794d96aacfb3U, 0xecf0d7a0fc5583a0U, 0xf41686c49db57244U,
1268*9356374aSAndroid Build Coastguard Worker 0x311c2875c522ced5U, 0x7d633293366b828bU, 0xae5dff9c02033197U,
1269*9356374aSAndroid Build Coastguard Worker 0xd9f57f830283fdfcU, 0xd072df63c324fd7bU, 0x4247cb9e59f71e6dU,
1270*9356374aSAndroid Build Coastguard Worker 0x52d9be85f074e608U, 0x67902e276c921f8bU, 0x00ba1cd8a3db53b6U,
1271*9356374aSAndroid Build Coastguard Worker 0x80e8a40eccd228a4U, 0x6122cd128006b2cdU, 0x796b805720085f81U,
1272*9356374aSAndroid Build Coastguard Worker 0xcbe3303674053bb0U, 0xbedbfc4411068a9cU, 0xee92fb5515482d44U,
1273*9356374aSAndroid Build Coastguard Worker 0x751bdd152d4d1c4aU, 0xd262d45a78a0635dU, 0x86fb897116c87c34U,
1274*9356374aSAndroid Build Coastguard Worker 0xd45d35e6ae3d4da0U, 0x8974836059cca109U, 0x2bd1a438703fc94bU,
1275*9356374aSAndroid Build Coastguard Worker 0x7b6306a34627ddcfU, 0x1a3bc84c17b1d542U, 0x20caba5f1d9e4a93U,
1276*9356374aSAndroid Build Coastguard Worker 0x547eb47b7282ee9cU, 0xe99e619a4f23aa43U, 0x6405fa00e2ec94d4U,
1277*9356374aSAndroid Build Coastguard Worker 0xde83bc408dd3dd04U, 0x9624ab50b148d445U, 0x3badd624dd9b0957U,
1278*9356374aSAndroid Build Coastguard Worker 0xe54ca5d70a80e5d6U, 0x5e9fcf4ccd211f4cU, 0x7647c3200069671fU,
1279*9356374aSAndroid Build Coastguard Worker 0x29ecd9f40041e073U, 0xf468107100525890U, 0x7182148d4066eeb4U,
1280*9356374aSAndroid Build Coastguard Worker 0xc6f14cd848405530U, 0xb8ada00e5a506a7cU, 0xa6d90811f0e4851cU,
1281*9356374aSAndroid Build Coastguard Worker 0x908f4a166d1da663U, 0x9a598e4e043287feU, 0x40eff1e1853f29fdU,
1282*9356374aSAndroid Build Coastguard Worker 0xd12bee59e68ef47cU, 0x82bb74f8301958ceU, 0xe36a52363c1faf01U,
1283*9356374aSAndroid Build Coastguard Worker 0xdc44e6c3cb279ac1U, 0x29ab103a5ef8c0b9U, 0x7415d448f6b6f0e7U,
1284*9356374aSAndroid Build Coastguard Worker 0x111b495b3464ad21U, 0xcab10dd900beec34U, 0x3d5d514f40eea742U,
1285*9356374aSAndroid Build Coastguard Worker 0x0cb4a5a3112a5112U, 0x47f0e785eaba72abU, 0x59ed216765690f56U,
1286*9356374aSAndroid Build Coastguard Worker 0x306869c13ec3532cU, 0x1e414218c73a13fbU, 0xe5d1929ef90898faU,
1287*9356374aSAndroid Build Coastguard Worker 0xdf45f746b74abf39U, 0x6b8bba8c328eb783U, 0x066ea92f3f326564U,
1288*9356374aSAndroid Build Coastguard Worker 0xc80a537b0efefebdU, 0xbd06742ce95f5f36U, 0x2c48113823b73704U,
1289*9356374aSAndroid Build Coastguard Worker 0xf75a15862ca504c5U, 0x9a984d73dbe722fbU, 0xc13e60d0d2e0ebbaU,
1290*9356374aSAndroid Build Coastguard Worker 0x318df905079926a8U, 0xfdf17746497f7052U, 0xfeb6ea8bedefa633U,
1291*9356374aSAndroid Build Coastguard Worker 0xfe64a52ee96b8fc0U, 0x3dfdce7aa3c673b0U, 0x06bea10ca65c084eU,
1292*9356374aSAndroid Build Coastguard Worker 0x486e494fcff30a62U, 0x5a89dba3c3efccfaU, 0xf89629465a75e01cU,
1293*9356374aSAndroid Build Coastguard Worker 0xf6bbb397f1135823U, 0x746aa07ded582e2cU, 0xa8c2a44eb4571cdcU,
1294*9356374aSAndroid Build Coastguard Worker 0x92f34d62616ce413U, 0x77b020baf9c81d17U, 0x0ace1474dc1d122eU,
1295*9356374aSAndroid Build Coastguard Worker 0x0d819992132456baU, 0x10e1fff697ed6c69U, 0xca8d3ffa1ef463c1U,
1296*9356374aSAndroid Build Coastguard Worker 0xbd308ff8a6b17cb2U, 0xac7cb3f6d05ddbdeU, 0x6bcdf07a423aa96bU,
1297*9356374aSAndroid Build Coastguard Worker 0x86c16c98d2c953c6U, 0xe871c7bf077ba8b7U, 0x11471cd764ad4972U,
1298*9356374aSAndroid Build Coastguard Worker 0xd598e40d3dd89bcfU, 0x4aff1d108d4ec2c3U, 0xcedf722a585139baU,
1299*9356374aSAndroid Build Coastguard Worker 0xc2974eb4ee658828U, 0x733d226229feea32U, 0x0806357d5a3f525fU,
1300*9356374aSAndroid Build Coastguard Worker 0xca07c2dcb0cf26f7U, 0xfc89b393dd02f0b5U, 0xbbac2078d443ace2U,
1301*9356374aSAndroid Build Coastguard Worker 0xd54b944b84aa4c0dU, 0x0a9e795e65d4df11U, 0x4d4617b5ff4a16d5U,
1302*9356374aSAndroid Build Coastguard Worker 0x504bced1bf8e4e45U, 0xe45ec2862f71e1d6U, 0x5d767327bb4e5a4cU,
1303*9356374aSAndroid Build Coastguard Worker 0x3a6a07f8d510f86fU, 0x890489f70a55368bU, 0x2b45ac74ccea842eU,
1304*9356374aSAndroid Build Coastguard Worker 0x3b0b8bc90012929dU, 0x09ce6ebb40173744U, 0xcc420a6a101d0515U,
1305*9356374aSAndroid Build Coastguard Worker 0x9fa946824a12232dU, 0x47939822dc96abf9U, 0x59787e2b93bc56f7U,
1306*9356374aSAndroid Build Coastguard Worker 0x57eb4edb3c55b65aU, 0xede622920b6b23f1U, 0xe95fab368e45ecedU,
1307*9356374aSAndroid Build Coastguard Worker 0x11dbcb0218ebb414U, 0xd652bdc29f26a119U, 0x4be76d3346f0495fU,
1308*9356374aSAndroid Build Coastguard Worker 0x6f70a4400c562ddbU, 0xcb4ccd500f6bb952U, 0x7e2000a41346a7a7U,
1309*9356374aSAndroid Build Coastguard Worker 0x8ed400668c0c28c8U, 0x728900802f0f32faU, 0x4f2b40a03ad2ffb9U,
1310*9356374aSAndroid Build Coastguard Worker 0xe2f610c84987bfa8U, 0x0dd9ca7d2df4d7c9U, 0x91503d1c79720dbbU,
1311*9356374aSAndroid Build Coastguard Worker 0x75a44c6397ce912aU, 0xc986afbe3ee11abaU, 0xfbe85badce996168U,
1312*9356374aSAndroid Build Coastguard Worker 0xfae27299423fb9c3U, 0xdccd879fc967d41aU, 0x5400e987bbc1c920U,
1313*9356374aSAndroid Build Coastguard Worker 0x290123e9aab23b68U, 0xf9a0b6720aaf6521U, 0xf808e40e8d5b3e69U,
1314*9356374aSAndroid Build Coastguard Worker 0xb60b1d1230b20e04U, 0xb1c6f22b5e6f48c2U, 0x1e38aeb6360b1af3U,
1315*9356374aSAndroid Build Coastguard Worker 0x25c6da63c38de1b0U, 0x579c487e5a38ad0eU, 0x2d835a9df0c6d851U,
1316*9356374aSAndroid Build Coastguard Worker 0xf8e431456cf88e65U, 0x1b8e9ecb641b58ffU, 0xe272467e3d222f3fU,
1317*9356374aSAndroid Build Coastguard Worker 0x5b0ed81dcc6abb0fU, 0x98e947129fc2b4e9U, 0x3f2398d747b36224U,
1318*9356374aSAndroid Build Coastguard Worker 0x8eec7f0d19a03aadU, 0x1953cf68300424acU, 0x5fa8c3423c052dd7U,
1319*9356374aSAndroid Build Coastguard Worker 0x3792f412cb06794dU, 0xe2bbd88bbee40bd0U, 0x5b6aceaeae9d0ec4U,
1320*9356374aSAndroid Build Coastguard Worker 0xf245825a5a445275U, 0xeed6e2f0f0d56712U, 0x55464dd69685606bU,
1321*9356374aSAndroid Build Coastguard Worker 0xaa97e14c3c26b886U, 0xd53dd99f4b3066a8U, 0xe546a8038efe4029U,
1322*9356374aSAndroid Build Coastguard Worker 0xde98520472bdd033U, 0x963e66858f6d4440U, 0xdde7001379a44aa8U,
1323*9356374aSAndroid Build Coastguard Worker 0x5560c018580d5d52U, 0xaab8f01e6e10b4a6U, 0xcab3961304ca70e8U,
1324*9356374aSAndroid Build Coastguard Worker 0x3d607b97c5fd0d22U, 0x8cb89a7db77c506aU, 0x77f3608e92adb242U,
1325*9356374aSAndroid Build Coastguard Worker 0x55f038b237591ed3U, 0x6b6c46dec52f6688U, 0x2323ac4b3b3da015U,
1326*9356374aSAndroid Build Coastguard Worker 0xabec975e0a0d081aU, 0x96e7bd358c904a21U, 0x7e50d64177da2e54U,
1327*9356374aSAndroid Build Coastguard Worker 0xdde50bd1d5d0b9e9U, 0x955e4ec64b44e864U, 0xbd5af13bef0b113eU,
1328*9356374aSAndroid Build Coastguard Worker 0xecb1ad8aeacdd58eU, 0x67de18eda5814af2U, 0x80eacf948770ced7U,
1329*9356374aSAndroid Build Coastguard Worker 0xa1258379a94d028dU, 0x096ee45813a04330U, 0x8bca9d6e188853fcU,
1330*9356374aSAndroid Build Coastguard Worker 0x775ea264cf55347dU, 0x95364afe032a819dU, 0x3a83ddbd83f52204U,
1331*9356374aSAndroid Build Coastguard Worker 0xc4926a9672793542U, 0x75b7053c0f178293U, 0x5324c68b12dd6338U,
1332*9356374aSAndroid Build Coastguard Worker 0xd3f6fc16ebca5e03U, 0x88f4bb1ca6bcf584U, 0x2b31e9e3d06c32e5U,
1333*9356374aSAndroid Build Coastguard Worker 0x3aff322e62439fcfU, 0x09befeb9fad487c2U, 0x4c2ebe687989a9b3U,
1334*9356374aSAndroid Build Coastguard Worker 0x0f9d37014bf60a10U, 0x538484c19ef38c94U, 0x2865a5f206b06fb9U,
1335*9356374aSAndroid Build Coastguard Worker 0xf93f87b7442e45d3U, 0xf78f69a51539d748U, 0xb573440e5a884d1bU,
1336*9356374aSAndroid Build Coastguard Worker 0x31680a88f8953030U, 0xfdc20d2b36ba7c3dU, 0x3d32907604691b4cU,
1337*9356374aSAndroid Build Coastguard Worker 0xa63f9a49c2c1b10fU, 0x0fcf80dc33721d53U, 0xd3c36113404ea4a8U,
1338*9356374aSAndroid Build Coastguard Worker 0x645a1cac083126e9U, 0x3d70a3d70a3d70a3U, 0xccccccccccccccccU,
1339*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x0000000000000000U, 0x0000000000000000U,
1340*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x0000000000000000U, 0x0000000000000000U,
1341*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x0000000000000000U, 0x0000000000000000U,
1342*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x0000000000000000U, 0x0000000000000000U,
1343*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x0000000000000000U, 0x0000000000000000U,
1344*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x0000000000000000U, 0x0000000000000000U,
1345*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x0000000000000000U, 0x0000000000000000U,
1346*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x0000000000000000U, 0x0000000000000000U,
1347*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x0000000000000000U, 0x0000000000000000U,
1348*9356374aSAndroid Build Coastguard Worker 0x0000000000000000U, 0x4000000000000000U, 0x5000000000000000U,
1349*9356374aSAndroid Build Coastguard Worker 0xa400000000000000U, 0x4d00000000000000U, 0xf020000000000000U,
1350*9356374aSAndroid Build Coastguard Worker 0x6c28000000000000U, 0xc732000000000000U, 0x3c7f400000000000U,
1351*9356374aSAndroid Build Coastguard Worker 0x4b9f100000000000U, 0x1e86d40000000000U, 0x1314448000000000U,
1352*9356374aSAndroid Build Coastguard Worker 0x17d955a000000000U, 0x5dcfab0800000000U, 0x5aa1cae500000000U,
1353*9356374aSAndroid Build Coastguard Worker 0xf14a3d9e40000000U, 0x6d9ccd05d0000000U, 0xe4820023a2000000U,
1354*9356374aSAndroid Build Coastguard Worker 0xdda2802c8a800000U, 0xd50b2037ad200000U, 0x4526f422cc340000U,
1355*9356374aSAndroid Build Coastguard Worker 0x9670b12b7f410000U, 0x3c0cdd765f114000U, 0xa5880a69fb6ac800U,
1356*9356374aSAndroid Build Coastguard Worker 0x8eea0d047a457a00U, 0x72a4904598d6d880U, 0x47a6da2b7f864750U,
1357*9356374aSAndroid Build Coastguard Worker 0x999090b65f67d924U, 0xfff4b4e3f741cf6dU, 0xbff8f10e7a8921a4U,
1358*9356374aSAndroid Build Coastguard Worker 0xaff72d52192b6a0dU, 0x9bf4f8a69f764490U, 0x02f236d04753d5b4U,
1359*9356374aSAndroid Build Coastguard Worker 0x01d762422c946590U, 0x424d3ad2b7b97ef5U, 0xd2e0898765a7deb2U,
1360*9356374aSAndroid Build Coastguard Worker 0x63cc55f49f88eb2fU, 0x3cbf6b71c76b25fbU, 0x8bef464e3945ef7aU,
1361*9356374aSAndroid Build Coastguard Worker 0x97758bf0e3cbb5acU, 0x3d52eeed1cbea317U, 0x4ca7aaa863ee4bddU,
1362*9356374aSAndroid Build Coastguard Worker 0x8fe8caa93e74ef6aU, 0xb3e2fd538e122b44U, 0x60dbbca87196b616U,
1363*9356374aSAndroid Build Coastguard Worker 0xbc8955e946fe31cdU, 0x6babab6398bdbe41U, 0xc696963c7eed2dd1U,
1364*9356374aSAndroid Build Coastguard Worker 0xfc1e1de5cf543ca2U, 0x3b25a55f43294bcbU, 0x49ef0eb713f39ebeU,
1365*9356374aSAndroid Build Coastguard Worker 0x6e3569326c784337U, 0x49c2c37f07965404U, 0xdc33745ec97be906U,
1366*9356374aSAndroid Build Coastguard Worker 0x69a028bb3ded71a3U, 0xc40832ea0d68ce0cU, 0xf50a3fa490c30190U,
1367*9356374aSAndroid Build Coastguard Worker 0x792667c6da79e0faU, 0x577001b891185938U, 0xed4c0226b55e6f86U,
1368*9356374aSAndroid Build Coastguard Worker 0x544f8158315b05b4U, 0x696361ae3db1c721U, 0x03bc3a19cd1e38e9U,
1369*9356374aSAndroid Build Coastguard Worker 0x04ab48a04065c723U, 0x62eb0d64283f9c76U, 0x3ba5d0bd324f8394U,
1370*9356374aSAndroid Build Coastguard Worker 0xca8f44ec7ee36479U, 0x7e998b13cf4e1ecbU, 0x9e3fedd8c321a67eU,
1371*9356374aSAndroid Build Coastguard Worker 0xc5cfe94ef3ea101eU, 0xbba1f1d158724a12U, 0x2a8a6e45ae8edc97U,
1372*9356374aSAndroid Build Coastguard Worker 0xf52d09d71a3293bdU, 0x593c2626705f9c56U, 0x6f8b2fb00c77836cU,
1373*9356374aSAndroid Build Coastguard Worker 0x0b6dfb9c0f956447U, 0x4724bd4189bd5eacU, 0x58edec91ec2cb657U,
1374*9356374aSAndroid Build Coastguard Worker 0x2f2967b66737e3edU, 0xbd79e0d20082ee74U, 0xecd8590680a3aa11U,
1375*9356374aSAndroid Build Coastguard Worker 0xe80e6f4820cc9495U, 0x3109058d147fdcddU, 0xbd4b46f0599fd415U,
1376*9356374aSAndroid Build Coastguard Worker 0x6c9e18ac7007c91aU, 0x03e2cf6bc604ddb0U, 0x84db8346b786151cU,
1377*9356374aSAndroid Build Coastguard Worker 0xe612641865679a63U, 0x4fcb7e8f3f60c07eU, 0xe3be5e330f38f09dU,
1378*9356374aSAndroid Build Coastguard Worker 0x5cadf5bfd3072cc5U, 0x73d9732fc7c8f7f6U, 0x2867e7fddcdd9afaU,
1379*9356374aSAndroid Build Coastguard Worker 0xb281e1fd541501b8U, 0x1f225a7ca91a4226U, 0x3375788de9b06958U,
1380*9356374aSAndroid Build Coastguard Worker 0x0052d6b1641c83aeU, 0xc0678c5dbd23a49aU, 0xf840b7ba963646e0U,
1381*9356374aSAndroid Build Coastguard Worker 0xb650e5a93bc3d898U, 0xa3e51f138ab4cebeU, 0xc66f336c36b10137U,
1382*9356374aSAndroid Build Coastguard Worker 0xb80b0047445d4184U, 0xa60dc059157491e5U, 0x87c89837ad68db2fU,
1383*9356374aSAndroid Build Coastguard Worker 0x29babe4598c311fbU, 0xf4296dd6fef3d67aU, 0x1899e4a65f58660cU,
1384*9356374aSAndroid Build Coastguard Worker 0x5ec05dcff72e7f8fU, 0x76707543f4fa1f73U, 0x6a06494a791c53a8U,
1385*9356374aSAndroid Build Coastguard Worker 0x0487db9d17636892U, 0x45a9d2845d3c42b6U, 0x0b8a2392ba45a9b2U,
1386*9356374aSAndroid Build Coastguard Worker 0x8e6cac7768d7141eU, 0x3207d795430cd926U, 0x7f44e6bd49e807b8U,
1387*9356374aSAndroid Build Coastguard Worker 0x5f16206c9c6209a6U, 0x36dba887c37a8c0fU, 0xc2494954da2c9789U,
1388*9356374aSAndroid Build Coastguard Worker 0xf2db9baa10b7bd6cU, 0x6f92829494e5acc7U, 0xcb772339ba1f17f9U,
1389*9356374aSAndroid Build Coastguard Worker 0xff2a760414536efbU, 0xfef5138519684abaU, 0x7eb258665fc25d69U,
1390*9356374aSAndroid Build Coastguard Worker 0xef2f773ffbd97a61U, 0xaafb550ffacfd8faU, 0x95ba2a53f983cf38U,
1391*9356374aSAndroid Build Coastguard Worker 0xdd945a747bf26183U, 0x94f971119aeef9e4U, 0x7a37cd5601aab85dU,
1392*9356374aSAndroid Build Coastguard Worker 0xac62e055c10ab33aU, 0x577b986b314d6009U, 0xed5a7e85fda0b80bU,
1393*9356374aSAndroid Build Coastguard Worker 0x14588f13be847307U, 0x596eb2d8ae258fc8U, 0x6fca5f8ed9aef3bbU,
1394*9356374aSAndroid Build Coastguard Worker 0x25de7bb9480d5854U, 0xaf561aa79a10ae6aU, 0x1b2ba1518094da04U,
1395*9356374aSAndroid Build Coastguard Worker 0x90fb44d2f05d0842U, 0x353a1607ac744a53U, 0x42889b8997915ce8U,
1396*9356374aSAndroid Build Coastguard Worker 0x69956135febada11U, 0x43fab9837e699095U, 0x94f967e45e03f4bbU,
1397*9356374aSAndroid Build Coastguard Worker 0x1d1be0eebac278f5U, 0x6462d92a69731732U, 0x7d7b8f7503cfdcfeU,
1398*9356374aSAndroid Build Coastguard Worker 0x5cda735244c3d43eU, 0x3a0888136afa64a7U, 0x088aaa1845b8fdd0U,
1399*9356374aSAndroid Build Coastguard Worker 0x8aad549e57273d45U, 0x36ac54e2f678864bU, 0x84576a1bb416a7ddU,
1400*9356374aSAndroid Build Coastguard Worker 0x656d44a2a11c51d5U, 0x9f644ae5a4b1b325U, 0x873d5d9f0dde1feeU,
1401*9356374aSAndroid Build Coastguard Worker 0xa90cb506d155a7eaU, 0x09a7f12442d588f2U, 0x0c11ed6d538aeb2fU,
1402*9356374aSAndroid Build Coastguard Worker 0x8f1668c8a86da5faU, 0xf96e017d694487bcU, 0x37c981dcc395a9acU,
1403*9356374aSAndroid Build Coastguard Worker 0x85bbe253f47b1417U, 0x93956d7478ccec8eU, 0x387ac8d1970027b2U,
1404*9356374aSAndroid Build Coastguard Worker 0x06997b05fcc0319eU, 0x441fece3bdf81f03U, 0xd527e81cad7626c3U,
1405*9356374aSAndroid Build Coastguard Worker 0x8a71e223d8d3b074U, 0xf6872d5667844e49U, 0xb428f8ac016561dbU,
1406*9356374aSAndroid Build Coastguard Worker 0xe13336d701beba52U, 0xecc0024661173473U, 0x27f002d7f95d0190U,
1407*9356374aSAndroid Build Coastguard Worker 0x31ec038df7b441f4U, 0x7e67047175a15271U, 0x0f0062c6e984d386U,
1408*9356374aSAndroid Build Coastguard Worker 0x52c07b78a3e60868U, 0xa7709a56ccdf8a82U, 0x88a66076400bb691U,
1409*9356374aSAndroid Build Coastguard Worker 0x6acff893d00ea435U, 0x0583f6b8c4124d43U, 0xc3727a337a8b704aU,
1410*9356374aSAndroid Build Coastguard Worker 0x744f18c0592e4c5cU, 0x1162def06f79df73U, 0x8addcb5645ac2ba8U,
1411*9356374aSAndroid Build Coastguard Worker 0x6d953e2bd7173692U, 0xc8fa8db6ccdd0437U, 0x1d9c9892400a22a2U,
1412*9356374aSAndroid Build Coastguard Worker 0x2503beb6d00cab4bU, 0x2e44ae64840fd61dU, 0x5ceaecfed289e5d2U,
1413*9356374aSAndroid Build Coastguard Worker 0x7425a83e872c5f47U, 0xd12f124e28f77719U, 0x82bd6b70d99aaa6fU,
1414*9356374aSAndroid Build Coastguard Worker 0x636cc64d1001550bU, 0x3c47f7e05401aa4eU, 0x65acfaec34810a71U,
1415*9356374aSAndroid Build Coastguard Worker 0x7f1839a741a14d0dU, 0x1ede48111209a050U, 0x934aed0aab460432U,
1416*9356374aSAndroid Build Coastguard Worker 0xf81da84d5617853fU, 0x36251260ab9d668eU, 0xc1d72b7c6b426019U,
1417*9356374aSAndroid Build Coastguard Worker 0xb24cf65b8612f81fU, 0xdee033f26797b627U, 0x169840ef017da3b1U,
1418*9356374aSAndroid Build Coastguard Worker 0x8e1f289560ee864eU, 0xf1a6f2bab92a27e2U, 0xae10af696774b1dbU,
1419*9356374aSAndroid Build Coastguard Worker 0xacca6da1e0a8ef29U, 0x17fd090a58d32af3U, 0xddfc4b4cef07f5b0U,
1420*9356374aSAndroid Build Coastguard Worker 0x4abdaf101564f98eU, 0x9d6d1ad41abe37f1U, 0x84c86189216dc5edU,
1421*9356374aSAndroid Build Coastguard Worker 0x32fd3cf5b4e49bb4U, 0x3fbc8c33221dc2a1U, 0x0fabaf3feaa5334aU,
1422*9356374aSAndroid Build Coastguard Worker 0x29cb4d87f2a7400eU, 0x743e20e9ef511012U, 0x914da9246b255416U,
1423*9356374aSAndroid Build Coastguard Worker 0x1ad089b6c2f7548eU, 0xa184ac2473b529b1U, 0xc9e5d72d90a2741eU,
1424*9356374aSAndroid Build Coastguard Worker 0x7e2fa67c7a658892U, 0xddbb901b98feeab7U, 0x552a74227f3ea565U,
1425*9356374aSAndroid Build Coastguard Worker 0xd53a88958f87275fU, 0x8a892abaf368f137U, 0x2d2b7569b0432d85U,
1426*9356374aSAndroid Build Coastguard Worker 0x9c3b29620e29fc73U, 0x8349f3ba91b47b8fU, 0x241c70a936219a73U,
1427*9356374aSAndroid Build Coastguard Worker 0xed238cd383aa0110U, 0xf4363804324a40aaU, 0xb143c6053edcd0d5U,
1428*9356374aSAndroid Build Coastguard Worker 0xdd94b7868e94050aU, 0xca7cf2b4191c8326U, 0xfd1c2f611f63a3f0U,
1429*9356374aSAndroid Build Coastguard Worker 0xbc633b39673c8cecU, 0xd5be0503e085d813U, 0x4b2d8644d8a74e18U,
1430*9356374aSAndroid Build Coastguard Worker 0xddf8e7d60ed1219eU, 0xcabb90e5c942b503U, 0x3d6a751f3b936243U,
1431*9356374aSAndroid Build Coastguard Worker 0x0cc512670a783ad4U, 0x27fb2b80668b24c5U, 0xb1f9f660802dedf6U,
1432*9356374aSAndroid Build Coastguard Worker 0x5e7873f8a0396973U, 0xdb0b487b6423e1e8U, 0x91ce1a9a3d2cda62U,
1433*9356374aSAndroid Build Coastguard Worker 0x7641a140cc7810fbU, 0xa9e904c87fcb0a9dU, 0x546345fa9fbdcd44U,
1434*9356374aSAndroid Build Coastguard Worker 0xa97c177947ad4095U, 0x49ed8eabcccc485dU, 0x5c68f256bfff5a74U,
1435*9356374aSAndroid Build Coastguard Worker 0x73832eec6fff3111U, 0xc831fd53c5ff7eabU, 0xba3e7ca8b77f5e55U,
1436*9356374aSAndroid Build Coastguard Worker 0x28ce1bd2e55f35ebU, 0x7980d163cf5b81b3U, 0xd7e105bcc332621fU,
1437*9356374aSAndroid Build Coastguard Worker 0x8dd9472bf3fefaa7U, 0xb14f98f6f0feb951U, 0x6ed1bf9a569f33d3U,
1438*9356374aSAndroid Build Coastguard Worker 0x0a862f80ec4700c8U, 0xcd27bb612758c0faU, 0x8038d51cb897789cU,
1439*9356374aSAndroid Build Coastguard Worker 0xe0470a63e6bd56c3U, 0x1858ccfce06cac74U, 0x0f37801e0c43ebc8U,
1440*9356374aSAndroid Build Coastguard Worker 0xd30560258f54e6baU, 0x47c6b82ef32a2069U, 0x4cdc331d57fa5441U,
1441*9356374aSAndroid Build Coastguard Worker 0xe0133fe4adf8e952U, 0x58180fddd97723a6U, 0x570f09eaa7ea7648U,
1442*9356374aSAndroid Build Coastguard Worker };
1443*9356374aSAndroid Build Coastguard Worker
1444*9356374aSAndroid Build Coastguard Worker } // namespace
1445*9356374aSAndroid Build Coastguard Worker ABSL_NAMESPACE_END
1446*9356374aSAndroid Build Coastguard Worker } // namespace absl
1447