Photon 1.0.0
Loading...
Searching...
No Matches
format-inl.h
Go to the documentation of this file.
1// Formatting library for C++ - implementation
2//
3// Copyright (c) 2012 - 2016, Victor Zverovich
4// All rights reserved.
5//
6// For the license information refer to format.h.
7
8#ifndef FMT_FORMAT_INL_H_
9#define FMT_FORMAT_INL_H_
10
11#include <algorithm>
12#include <cctype>
13#include <cerrno> // errno
14#include <climits>
15#include <cmath>
16#include <cstdarg>
17#include <cstring> // std::memmove
18#include <cwchar>
19#include <exception>
20
21#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
22#include <locale>
23#endif
24
25#ifdef _WIN32
26#include <io.h> // _isatty
27#endif
28
29#include "format.h"
30
32namespace detail
33{
34
35 FMT_FUNC void assert_fail(const char* file, int line, const char* message)
36 {
37 // Use unchecked std::fprintf to avoid triggering another assertion when
38 // writing to stderr fails
39 std::fprintf(stderr, "%s:%d: assertion failed: %s", file, line, message);
40 // Chosen instead of std::abort to satisfy Clang in CUDA mode during device
41 // code pass.
42 std::terminate();
43 }
44
45 FMT_FUNC void throw_format_error(const char* message)
46 {
47 FMT_THROW(format_error(message));
48 }
49
50 FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code, string_view message) noexcept
51 {
52 // Report error code making sure that the output fits into
53 // inline_buffer_size to avoid dynamic memory allocation and potential
54 // bad_alloc.
55 out.try_resize(0);
56 static const char SEP[] = ": ";
57 static const char ERROR_STR[] = "error ";
58 // Subtract 2 to account for terminating null characters in SEP and ERROR_STR.
59 size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2;
60 auto abs_value = static_cast<uint32_or_64_or_128_t<int>>(error_code);
61 if (detail::is_negative(error_code))
62 {
63 abs_value = 0 - abs_value;
64 ++error_code_size;
65 }
66 error_code_size += detail::to_unsigned(detail::count_digits(abs_value));
67 auto it = buffer_appender<char>(out);
68 if (message.size() <= inline_buffer_size - error_code_size)
69 format_to(it, FMT_STRING("{}{}"), message, SEP);
70 format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code);
71 FMT_ASSERT(out.size() <= inline_buffer_size, "");
72 }
73
74 FMT_FUNC void report_error(format_func func, int error_code, const char* message) noexcept
75 {
76 memory_buffer full_message;
77 func(full_message, error_code, message);
78 // Don't use fwrite_fully because the latter may throw.
79 if (std::fwrite(full_message.data(), full_message.size(), 1, stderr) > 0)
80 std::fputc('\n', stderr);
81 }
82
83 // A wrapper around fwrite that throws on error.
84 inline void fwrite_fully(const void* ptr, size_t size, size_t count, FILE* stream)
85 {
86 size_t written = std::fwrite(ptr, size, count, stream);
87 if (written < count)
88 FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
89 }
90
91#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
92 template <typename Locale>
93 locale_ref::locale_ref(const Locale& loc)
94 : locale_(&loc)
95 {
96 static_assert(std::is_same<Locale, std::locale>::value, "");
97 }
98
99 template <typename Locale>
100 Locale locale_ref::get() const
101 {
102 static_assert(std::is_same<Locale, std::locale>::value, "");
103 return locale_ ? *static_cast<const std::locale*>(locale_) : std::locale();
104 }
105
106 template <typename Char>
108 {
109 auto& facet = std::use_facet<std::numpunct<Char>>(loc.get<std::locale>());
110 auto grouping = facet.grouping();
111 auto thousands_sep = grouping.empty() ? Char() : facet.thousands_sep();
112 return {std::move(grouping), thousands_sep};
113 }
114 template <typename Char>
116 {
117 return std::use_facet<std::numpunct<Char>>(loc.get<std::locale>())
118 .decimal_point();
119 }
120#else
121 template <typename Char>
123 {
124 return {"\03", FMT_STATIC_THOUSANDS_SEPARATOR};
125 }
126 template <typename Char>
128 {
129 return '.';
130 }
131#endif
132} // namespace detail
133
134#if !FMT_MSC_VERSION
135FMT_API FMT_FUNC format_error::~format_error() noexcept = default;
136#endif
137
138FMT_FUNC std::system_error vsystem_error(int error_code, string_view format_str, format_args args)
139{
140 auto ec = std::error_code(error_code, std::generic_category());
141 return std::system_error(ec, vformat(format_str, args));
142}
143
144namespace detail
145{
146
147 template <typename F>
149 {
150 return x.f == y.f && x.e == y.e;
151 }
152
153 // Compilers should be able to optimize this into the ror instruction.
154 FMT_CONSTEXPR inline uint32_t rotr(uint32_t n, uint32_t r) noexcept
155 {
156 r &= 31;
157 return (n >> r) | (n << (32 - r));
158 }
159 FMT_CONSTEXPR inline uint64_t rotr(uint64_t n, uint32_t r) noexcept
160 {
161 r &= 63;
162 return (n >> r) | (n << (64 - r));
163 }
164
165 // Computes 128-bit result of multiplication of two 64-bit unsigned integers.
166 inline uint128_fallback umul128(uint64_t x, uint64_t y) noexcept
167 {
168#if FMT_USE_INT128
169 auto p = static_cast<uint128_opt>(x) * static_cast<uint128_opt>(y);
170 return {static_cast<uint64_t>(p >> 64), static_cast<uint64_t>(p)};
171#elif defined(_MSC_VER) && defined(_M_X64)
172 auto result = uint128_fallback();
173 result.lo_ = _umul128(x, y, &result.hi_);
174 return result;
175#else
176 const uint64_t mask = static_cast<uint64_t>(max_value<uint32_t>());
177
178 uint64_t a = x >> 32;
179 uint64_t b = x & mask;
180 uint64_t c = y >> 32;
181 uint64_t d = y & mask;
182
183 uint64_t ac = a * c;
184 uint64_t bc = b * c;
185 uint64_t ad = a * d;
186 uint64_t bd = b * d;
187
188 uint64_t intermediate = (bd >> 32) + (ad & mask) + (bc & mask);
189
190 return {ac + (intermediate >> 32) + (ad >> 32) + (bc >> 32),
191 (intermediate << 32) + (bd & mask)};
192#endif
193 }
194
195 // Implementation of Dragonbox algorithm: https://github.com/jk-jeon/dragonbox.
196 namespace dragonbox
197 {
198 // Computes upper 64 bits of multiplication of two 64-bit unsigned integers.
199 inline uint64_t umul128_upper64(uint64_t x, uint64_t y) noexcept
200 {
201#if FMT_USE_INT128
202 auto p = static_cast<uint128_opt>(x) * static_cast<uint128_opt>(y);
203 return static_cast<uint64_t>(p >> 64);
204#elif defined(_MSC_VER) && defined(_M_X64)
205 return __umulh(x, y);
206#else
207 return umul128(x, y).high();
208#endif
209 }
210
211 // Computes upper 128 bits of multiplication of a 64-bit unsigned integer and a
212 // 128-bit unsigned integer.
214 uint128_fallback y) noexcept
215 {
216 uint128_fallback r = umul128(x, y.high());
217 r += umul128_upper64(x, y.low());
218 return r;
219 }
220
221 // Computes upper 64 bits of multiplication of a 32-bit unsigned integer and a
222 // 64-bit unsigned integer.
223 inline uint64_t umul96_upper64(uint32_t x, uint64_t y) noexcept
224 {
225 return umul128_upper64(static_cast<uint64_t>(x) << 32, y);
226 }
227
228 // Computes lower 128 bits of multiplication of a 64-bit unsigned integer and a
229 // 128-bit unsigned integer.
231 uint128_fallback y) noexcept
232 {
233 uint64_t high = x * y.high();
234 uint128_fallback high_low = umul128(x, y.low());
235 return {high + high_low.high(), high_low.low()};
236 }
237
238 // Computes lower 64 bits of multiplication of a 32-bit unsigned integer and a
239 // 64-bit unsigned integer.
240 inline uint64_t umul96_lower64(uint32_t x, uint64_t y) noexcept
241 {
242 return x * y;
243 }
244
245 // Computes floor(log10(pow(2, e))) for e in [-2620, 2620] using the method from
246 // https://fmt.dev/papers/Dragonbox.pdf#page=28, section 6.1.
247 inline int floor_log10_pow2(int e) noexcept
248 {
249 FMT_ASSERT(e <= 2620 && e >= -2620, "too large exponent");
250 static_assert((-1 >> 1) == -1, "right shift is not arithmetic");
251 return (e * 315653) >> 20;
252 }
253
254 // Various fast log computations.
255 inline int floor_log2_pow10(int e) noexcept
256 {
257 FMT_ASSERT(e <= 1233 && e >= -1233, "too large exponent");
258 return (e * 1741647) >> 19;
259 }
260 inline int floor_log10_pow2_minus_log10_4_over_3(int e) noexcept
261 {
262 FMT_ASSERT(e <= 2936 && e >= -2985, "too large exponent");
263 return (e * 631305 - 261663) >> 21;
264 }
265
266 static constexpr struct
267 {
268 uint32_t divisor;
270 } div_small_pow10_infos[] = {{10, 16}, {100, 16}};
271
272 // Replaces n by floor(n / pow(10, N)) returning true if and only if n is
273 // divisible by pow(10, N).
274 // Precondition: n <= pow(10, N + 1).
275 template <int N>
276 bool check_divisibility_and_divide_by_pow10(uint32_t& n) noexcept
277 {
278 // The numbers below are chosen such that:
279 // 1. floor(n/d) = floor(nm / 2^k) where d=10 or d=100,
280 // 2. nm mod 2^k < m if and only if n is divisible by d,
281 // where m is magic_number, k is shift_amount
282 // and d is divisor.
283 //
284 // Item 1 is a common technique of replacing division by a constant with
285 // multiplication, see e.g. "Division by Invariant Integers Using
286 // Multiplication" by Granlund and Montgomery (1994). magic_number (m) is set
287 // to ceil(2^k/d) for large enough k.
288 // The idea for item 2 originates from Schubfach.
289 constexpr auto info = div_small_pow10_infos[N - 1];
290 FMT_ASSERT(n <= info.divisor * 10, "n is too large");
291 constexpr uint32_t magic_number =
292 (1u << info.shift_amount) / info.divisor + 1;
293 n *= magic_number;
294 const uint32_t comparison_mask = (1u << info.shift_amount) - 1;
295 bool result = (n & comparison_mask) < magic_number;
296 n >>= info.shift_amount;
297 return result;
298 }
299
300 // Computes floor(n / pow(10, N)) for small n and N.
301 // Precondition: n <= pow(10, N + 1).
302 template <int N>
303 uint32_t small_division_by_pow10(uint32_t n) noexcept
304 {
305 constexpr auto info = div_small_pow10_infos[N - 1];
306 FMT_ASSERT(n <= info.divisor * 10, "n is too large");
307 constexpr uint32_t magic_number =
308 (1u << info.shift_amount) / info.divisor + 1;
309 return (n * magic_number) >> info.shift_amount;
310 }
311
312 // Computes floor(n / 10^(kappa + 1)) (float)
313 inline uint32_t divide_by_10_to_kappa_plus_1(uint32_t n) noexcept
314 {
315 // 1374389535 = ceil(2^37/100)
316 return static_cast<uint32_t>((static_cast<uint64_t>(n) * 1374389535) >> 37);
317 }
318 // Computes floor(n / 10^(kappa + 1)) (double)
319 inline uint64_t divide_by_10_to_kappa_plus_1(uint64_t n) noexcept
320 {
321 // 2361183241434822607 = ceil(2^(64+7)/1000)
322 return umul128_upper64(n, 2361183241434822607ull) >> 7;
323 }
324
325 // Various subroutines using pow10 cache
326 template <class T>
328
329 template <>
330 struct cache_accessor<float>
331 {
332 using carrier_uint = float_info<float>::carrier_uint;
333 using cache_entry_type = uint64_t;
334
335 static uint64_t get_cached_power(int k) noexcept
336 {
337 FMT_ASSERT(k >= float_info<float>::min_k && k <= float_info<float>::max_k,
338 "k is out of range");
339 static constexpr const uint64_t pow10_significands[] = {
340 0x81ceb32c4b43fcf5, 0xa2425ff75e14fc32, 0xcad2f7f5359a3b3f,
341 0xfd87b5f28300ca0e, 0x9e74d1b791e07e49, 0xc612062576589ddb,
342 0xf79687aed3eec552, 0x9abe14cd44753b53, 0xc16d9a0095928a28,
343 0xf1c90080baf72cb2, 0x971da05074da7bef, 0xbce5086492111aeb,
344 0xec1e4a7db69561a6, 0x9392ee8e921d5d08, 0xb877aa3236a4b44a,
345 0xe69594bec44de15c, 0x901d7cf73ab0acda, 0xb424dc35095cd810,
346 0xe12e13424bb40e14, 0x8cbccc096f5088cc, 0xafebff0bcb24aaff,
347 0xdbe6fecebdedd5bf, 0x89705f4136b4a598, 0xabcc77118461cefd,
348 0xd6bf94d5e57a42bd, 0x8637bd05af6c69b6, 0xa7c5ac471b478424,
349 0xd1b71758e219652c, 0x83126e978d4fdf3c, 0xa3d70a3d70a3d70b,
350 0xcccccccccccccccd, 0x8000000000000000, 0xa000000000000000,
351 0xc800000000000000, 0xfa00000000000000, 0x9c40000000000000,
352 0xc350000000000000, 0xf424000000000000, 0x9896800000000000,
353 0xbebc200000000000, 0xee6b280000000000, 0x9502f90000000000,
354 0xba43b74000000000, 0xe8d4a51000000000, 0x9184e72a00000000,
355 0xb5e620f480000000, 0xe35fa931a0000000, 0x8e1bc9bf04000000,
356 0xb1a2bc2ec5000000, 0xde0b6b3a76400000, 0x8ac7230489e80000,
357 0xad78ebc5ac620000, 0xd8d726b7177a8000, 0x878678326eac9000,
358 0xa968163f0a57b400, 0xd3c21bcecceda100, 0x84595161401484a0,
359 0xa56fa5b99019a5c8, 0xcecb8f27f4200f3a, 0x813f3978f8940985,
360 0xa18f07d736b90be6, 0xc9f2c9cd04674edf, 0xfc6f7c4045812297,
361 0x9dc5ada82b70b59e, 0xc5371912364ce306, 0xf684df56c3e01bc7,
362 0x9a130b963a6c115d, 0xc097ce7bc90715b4, 0xf0bdc21abb48db21,
363 0x96769950b50d88f5, 0xbc143fa4e250eb32, 0xeb194f8e1ae525fe,
364 0x92efd1b8d0cf37bf, 0xb7abc627050305ae, 0xe596b7b0c643c71a,
365 0x8f7e32ce7bea5c70, 0xb35dbf821ae4f38c, 0xe0352f62a19e306f};
366 return pow10_significands[k - float_info<float>::min_k];
367 }
368
369 struct compute_mul_result
370 {
373 };
374 struct compute_mul_parity_result
375 {
376 bool parity;
378 };
379
380 static compute_mul_result compute_mul(
381 carrier_uint u, const cache_entry_type& cache) noexcept
382 {
383 auto r = umul96_upper64(u, cache);
384 return {static_cast<carrier_uint>(r >> 32),
385 static_cast<carrier_uint>(r) == 0};
386 }
387
388 static uint32_t compute_delta(const cache_entry_type& cache,
389 int beta) noexcept
390 {
391 return static_cast<uint32_t>(cache >> (64 - 1 - beta));
392 }
393
394 static compute_mul_parity_result compute_mul_parity(
395 carrier_uint two_f, const cache_entry_type& cache, int beta) noexcept
396 {
397 FMT_ASSERT(beta >= 1, "");
398 FMT_ASSERT(beta < 64, "");
399
400 auto r = umul96_lower64(two_f, cache);
401 return {((r >> (64 - beta)) & 1) != 0,
402 static_cast<uint32_t>(r >> (32 - beta)) == 0};
403 }
404
406 const cache_entry_type& cache, int beta) noexcept
407 {
408 return static_cast<carrier_uint>(
409 (cache - (cache >> (num_significand_bits<float>() + 2))) >>
410 (64 - num_significand_bits<float>() - 1 - beta));
411 }
412
414 const cache_entry_type& cache, int beta) noexcept
415 {
416 return static_cast<carrier_uint>(
417 (cache + (cache >> (num_significand_bits<float>() + 1))) >>
418 (64 - num_significand_bits<float>() - 1 - beta));
419 }
420
422 const cache_entry_type& cache, int beta) noexcept
423 {
424 return (static_cast<carrier_uint>(
425 cache >> (64 - num_significand_bits<float>() - 2 - beta)) +
426 1) /
427 2;
428 }
429 };
430
431 template <>
432 struct cache_accessor<double>
433 {
434 using carrier_uint = float_info<double>::carrier_uint;
436
437 static uint128_fallback get_cached_power(int k) noexcept
438 {
439 FMT_ASSERT(k >= float_info<double>::min_k && k <= float_info<double>::max_k,
440 "k is out of range");
441
442 static constexpr const uint128_fallback pow10_significands[] = {
443#if FMT_USE_FULL_CACHE_DRAGONBOX
444 {0xff77b1fcbebcdc4f, 0x25e8e89c13bb0f7b},
445 {0x9faacf3df73609b1, 0x77b191618c54e9ad},
446 {0xc795830d75038c1d, 0xd59df5b9ef6a2418},
447 {0xf97ae3d0d2446f25, 0x4b0573286b44ad1e},
448 {0x9becce62836ac577, 0x4ee367f9430aec33},
449 {0xc2e801fb244576d5, 0x229c41f793cda740},
450 {0xf3a20279ed56d48a, 0x6b43527578c11110},
451 {0x9845418c345644d6, 0x830a13896b78aaaa},
452 {0xbe5691ef416bd60c, 0x23cc986bc656d554},
453 {0xedec366b11c6cb8f, 0x2cbfbe86b7ec8aa9},
454 {0x94b3a202eb1c3f39, 0x7bf7d71432f3d6aa},
455 {0xb9e08a83a5e34f07, 0xdaf5ccd93fb0cc54},
456 {0xe858ad248f5c22c9, 0xd1b3400f8f9cff69},
457 {0x91376c36d99995be, 0x23100809b9c21fa2},
458 {0xb58547448ffffb2d, 0xabd40a0c2832a78b},
459 {0xe2e69915b3fff9f9, 0x16c90c8f323f516d},
460 {0x8dd01fad907ffc3b, 0xae3da7d97f6792e4},
461 {0xb1442798f49ffb4a, 0x99cd11cfdf41779d},
462 {0xdd95317f31c7fa1d, 0x40405643d711d584},
463 {0x8a7d3eef7f1cfc52, 0x482835ea666b2573},
464 {0xad1c8eab5ee43b66, 0xda3243650005eed0},
465 {0xd863b256369d4a40, 0x90bed43e40076a83},
466 {0x873e4f75e2224e68, 0x5a7744a6e804a292},
467 {0xa90de3535aaae202, 0x711515d0a205cb37},
468 {0xd3515c2831559a83, 0x0d5a5b44ca873e04},
469 {0x8412d9991ed58091, 0xe858790afe9486c3},
470 {0xa5178fff668ae0b6, 0x626e974dbe39a873},
471 {0xce5d73ff402d98e3, 0xfb0a3d212dc81290},
472 {0x80fa687f881c7f8e, 0x7ce66634bc9d0b9a},
473 {0xa139029f6a239f72, 0x1c1fffc1ebc44e81},
474 {0xc987434744ac874e, 0xa327ffb266b56221},
475 {0xfbe9141915d7a922, 0x4bf1ff9f0062baa9},
476 {0x9d71ac8fada6c9b5, 0x6f773fc3603db4aa},
477 {0xc4ce17b399107c22, 0xcb550fb4384d21d4},
478 {0xf6019da07f549b2b, 0x7e2a53a146606a49},
479 {0x99c102844f94e0fb, 0x2eda7444cbfc426e},
480 {0xc0314325637a1939, 0xfa911155fefb5309},
481 {0xf03d93eebc589f88, 0x793555ab7eba27cb},
482 {0x96267c7535b763b5, 0x4bc1558b2f3458df},
483 {0xbbb01b9283253ca2, 0x9eb1aaedfb016f17},
484 {0xea9c227723ee8bcb, 0x465e15a979c1cadd},
485 {0x92a1958a7675175f, 0x0bfacd89ec191eca},
486 {0xb749faed14125d36, 0xcef980ec671f667c},
487 {0xe51c79a85916f484, 0x82b7e12780e7401b},
488 {0x8f31cc0937ae58d2, 0xd1b2ecb8b0908811},
489 {0xb2fe3f0b8599ef07, 0x861fa7e6dcb4aa16},
490 {0xdfbdcece67006ac9, 0x67a791e093e1d49b},
491 {0x8bd6a141006042bd, 0xe0c8bb2c5c6d24e1},
492 {0xaecc49914078536d, 0x58fae9f773886e19},
493 {0xda7f5bf590966848, 0xaf39a475506a899f},
494 {0x888f99797a5e012d, 0x6d8406c952429604},
495 {0xaab37fd7d8f58178, 0xc8e5087ba6d33b84},
496 {0xd5605fcdcf32e1d6, 0xfb1e4a9a90880a65},
497 {0x855c3be0a17fcd26, 0x5cf2eea09a550680},
498 {0xa6b34ad8c9dfc06f, 0xf42faa48c0ea481f},
499 {0xd0601d8efc57b08b, 0xf13b94daf124da27},
500 {0x823c12795db6ce57, 0x76c53d08d6b70859},
501 {0xa2cb1717b52481ed, 0x54768c4b0c64ca6f},
502 {0xcb7ddcdda26da268, 0xa9942f5dcf7dfd0a},
503 {0xfe5d54150b090b02, 0xd3f93b35435d7c4d},
504 {0x9efa548d26e5a6e1, 0xc47bc5014a1a6db0},
505 {0xc6b8e9b0709f109a, 0x359ab6419ca1091c},
506 {0xf867241c8cc6d4c0, 0xc30163d203c94b63},
507 {0x9b407691d7fc44f8, 0x79e0de63425dcf1e},
508 {0xc21094364dfb5636, 0x985915fc12f542e5},
509 {0xf294b943e17a2bc4, 0x3e6f5b7b17b2939e},
510 {0x979cf3ca6cec5b5a, 0xa705992ceecf9c43},
511 {0xbd8430bd08277231, 0x50c6ff782a838354},
512 {0xece53cec4a314ebd, 0xa4f8bf5635246429},
513 {0x940f4613ae5ed136, 0x871b7795e136be9a},
514 {0xb913179899f68584, 0x28e2557b59846e40},
515 {0xe757dd7ec07426e5, 0x331aeada2fe589d0},
516 {0x9096ea6f3848984f, 0x3ff0d2c85def7622},
517 {0xb4bca50b065abe63, 0x0fed077a756b53aa},
518 {0xe1ebce4dc7f16dfb, 0xd3e8495912c62895},
519 {0x8d3360f09cf6e4bd, 0x64712dd7abbbd95d},
520 {0xb080392cc4349dec, 0xbd8d794d96aacfb4},
521 {0xdca04777f541c567, 0xecf0d7a0fc5583a1},
522 {0x89e42caaf9491b60, 0xf41686c49db57245},
523 {0xac5d37d5b79b6239, 0x311c2875c522ced6},
524 {0xd77485cb25823ac7, 0x7d633293366b828c},
525 {0x86a8d39ef77164bc, 0xae5dff9c02033198},
526 {0xa8530886b54dbdeb, 0xd9f57f830283fdfd},
527 {0xd267caa862a12d66, 0xd072df63c324fd7c},
528 {0x8380dea93da4bc60, 0x4247cb9e59f71e6e},
529 {0xa46116538d0deb78, 0x52d9be85f074e609},
530 {0xcd795be870516656, 0x67902e276c921f8c},
531 {0x806bd9714632dff6, 0x00ba1cd8a3db53b7},
532 {0xa086cfcd97bf97f3, 0x80e8a40eccd228a5},
533 {0xc8a883c0fdaf7df0, 0x6122cd128006b2ce},
534 {0xfad2a4b13d1b5d6c, 0x796b805720085f82},
535 {0x9cc3a6eec6311a63, 0xcbe3303674053bb1},
536 {0xc3f490aa77bd60fc, 0xbedbfc4411068a9d},
537 {0xf4f1b4d515acb93b, 0xee92fb5515482d45},
538 {0x991711052d8bf3c5, 0x751bdd152d4d1c4b},
539 {0xbf5cd54678eef0b6, 0xd262d45a78a0635e},
540 {0xef340a98172aace4, 0x86fb897116c87c35},
541 {0x9580869f0e7aac0e, 0xd45d35e6ae3d4da1},
542 {0xbae0a846d2195712, 0x8974836059cca10a},
543 {0xe998d258869facd7, 0x2bd1a438703fc94c},
544 {0x91ff83775423cc06, 0x7b6306a34627ddd0},
545 {0xb67f6455292cbf08, 0x1a3bc84c17b1d543},
546 {0xe41f3d6a7377eeca, 0x20caba5f1d9e4a94},
547 {0x8e938662882af53e, 0x547eb47b7282ee9d},
548 {0xb23867fb2a35b28d, 0xe99e619a4f23aa44},
549 {0xdec681f9f4c31f31, 0x6405fa00e2ec94d5},
550 {0x8b3c113c38f9f37e, 0xde83bc408dd3dd05},
551 {0xae0b158b4738705e, 0x9624ab50b148d446},
552 {0xd98ddaee19068c76, 0x3badd624dd9b0958},
553 {0x87f8a8d4cfa417c9, 0xe54ca5d70a80e5d7},
554 {0xa9f6d30a038d1dbc, 0x5e9fcf4ccd211f4d},
555 {0xd47487cc8470652b, 0x7647c32000696720},
556 {0x84c8d4dfd2c63f3b, 0x29ecd9f40041e074},
557 {0xa5fb0a17c777cf09, 0xf468107100525891},
558 {0xcf79cc9db955c2cc, 0x7182148d4066eeb5},
559 {0x81ac1fe293d599bf, 0xc6f14cd848405531},
560 {0xa21727db38cb002f, 0xb8ada00e5a506a7d},
561 {0xca9cf1d206fdc03b, 0xa6d90811f0e4851d},
562 {0xfd442e4688bd304a, 0x908f4a166d1da664},
563 {0x9e4a9cec15763e2e, 0x9a598e4e043287ff},
564 {0xc5dd44271ad3cdba, 0x40eff1e1853f29fe},
565 {0xf7549530e188c128, 0xd12bee59e68ef47d},
566 {0x9a94dd3e8cf578b9, 0x82bb74f8301958cf},
567 {0xc13a148e3032d6e7, 0xe36a52363c1faf02},
568 {0xf18899b1bc3f8ca1, 0xdc44e6c3cb279ac2},
569 {0x96f5600f15a7b7e5, 0x29ab103a5ef8c0ba},
570 {0xbcb2b812db11a5de, 0x7415d448f6b6f0e8},
571 {0xebdf661791d60f56, 0x111b495b3464ad22},
572 {0x936b9fcebb25c995, 0xcab10dd900beec35},
573 {0xb84687c269ef3bfb, 0x3d5d514f40eea743},
574 {0xe65829b3046b0afa, 0x0cb4a5a3112a5113},
575 {0x8ff71a0fe2c2e6dc, 0x47f0e785eaba72ac},
576 {0xb3f4e093db73a093, 0x59ed216765690f57},
577 {0xe0f218b8d25088b8, 0x306869c13ec3532d},
578 {0x8c974f7383725573, 0x1e414218c73a13fc},
579 {0xafbd2350644eeacf, 0xe5d1929ef90898fb},
580 {0xdbac6c247d62a583, 0xdf45f746b74abf3a},
581 {0x894bc396ce5da772, 0x6b8bba8c328eb784},
582 {0xab9eb47c81f5114f, 0x066ea92f3f326565},
583 {0xd686619ba27255a2, 0xc80a537b0efefebe},
584 {0x8613fd0145877585, 0xbd06742ce95f5f37},
585 {0xa798fc4196e952e7, 0x2c48113823b73705},
586 {0xd17f3b51fca3a7a0, 0xf75a15862ca504c6},
587 {0x82ef85133de648c4, 0x9a984d73dbe722fc},
588 {0xa3ab66580d5fdaf5, 0xc13e60d0d2e0ebbb},
589 {0xcc963fee10b7d1b3, 0x318df905079926a9},
590 {0xffbbcfe994e5c61f, 0xfdf17746497f7053},
591 {0x9fd561f1fd0f9bd3, 0xfeb6ea8bedefa634},
592 {0xc7caba6e7c5382c8, 0xfe64a52ee96b8fc1},
593 {0xf9bd690a1b68637b, 0x3dfdce7aa3c673b1},
594 {0x9c1661a651213e2d, 0x06bea10ca65c084f},
595 {0xc31bfa0fe5698db8, 0x486e494fcff30a63},
596 {0xf3e2f893dec3f126, 0x5a89dba3c3efccfb},
597 {0x986ddb5c6b3a76b7, 0xf89629465a75e01d},
598 {0xbe89523386091465, 0xf6bbb397f1135824},
599 {0xee2ba6c0678b597f, 0x746aa07ded582e2d},
600 {0x94db483840b717ef, 0xa8c2a44eb4571cdd},
601 {0xba121a4650e4ddeb, 0x92f34d62616ce414},
602 {0xe896a0d7e51e1566, 0x77b020baf9c81d18},
603 {0x915e2486ef32cd60, 0x0ace1474dc1d122f},
604 {0xb5b5ada8aaff80b8, 0x0d819992132456bb},
605 {0xe3231912d5bf60e6, 0x10e1fff697ed6c6a},
606 {0x8df5efabc5979c8f, 0xca8d3ffa1ef463c2},
607 {0xb1736b96b6fd83b3, 0xbd308ff8a6b17cb3},
608 {0xddd0467c64bce4a0, 0xac7cb3f6d05ddbdf},
609 {0x8aa22c0dbef60ee4, 0x6bcdf07a423aa96c},
610 {0xad4ab7112eb3929d, 0x86c16c98d2c953c7},
611 {0xd89d64d57a607744, 0xe871c7bf077ba8b8},
612 {0x87625f056c7c4a8b, 0x11471cd764ad4973},
613 {0xa93af6c6c79b5d2d, 0xd598e40d3dd89bd0},
614 {0xd389b47879823479, 0x4aff1d108d4ec2c4},
615 {0x843610cb4bf160cb, 0xcedf722a585139bb},
616 {0xa54394fe1eedb8fe, 0xc2974eb4ee658829},
617 {0xce947a3da6a9273e, 0x733d226229feea33},
618 {0x811ccc668829b887, 0x0806357d5a3f5260},
619 {0xa163ff802a3426a8, 0xca07c2dcb0cf26f8},
620 {0xc9bcff6034c13052, 0xfc89b393dd02f0b6},
621 {0xfc2c3f3841f17c67, 0xbbac2078d443ace3},
622 {0x9d9ba7832936edc0, 0xd54b944b84aa4c0e},
623 {0xc5029163f384a931, 0x0a9e795e65d4df12},
624 {0xf64335bcf065d37d, 0x4d4617b5ff4a16d6},
625 {0x99ea0196163fa42e, 0x504bced1bf8e4e46},
626 {0xc06481fb9bcf8d39, 0xe45ec2862f71e1d7},
627 {0xf07da27a82c37088, 0x5d767327bb4e5a4d},
628 {0x964e858c91ba2655, 0x3a6a07f8d510f870},
629 {0xbbe226efb628afea, 0x890489f70a55368c},
630 {0xeadab0aba3b2dbe5, 0x2b45ac74ccea842f},
631 {0x92c8ae6b464fc96f, 0x3b0b8bc90012929e},
632 {0xb77ada0617e3bbcb, 0x09ce6ebb40173745},
633 {0xe55990879ddcaabd, 0xcc420a6a101d0516},
634 {0x8f57fa54c2a9eab6, 0x9fa946824a12232e},
635 {0xb32df8e9f3546564, 0x47939822dc96abfa},
636 {0xdff9772470297ebd, 0x59787e2b93bc56f8},
637 {0x8bfbea76c619ef36, 0x57eb4edb3c55b65b},
638 {0xaefae51477a06b03, 0xede622920b6b23f2},
639 {0xdab99e59958885c4, 0xe95fab368e45ecee},
640 {0x88b402f7fd75539b, 0x11dbcb0218ebb415},
641 {0xaae103b5fcd2a881, 0xd652bdc29f26a11a},
642 {0xd59944a37c0752a2, 0x4be76d3346f04960},
643 {0x857fcae62d8493a5, 0x6f70a4400c562ddc},
644 {0xa6dfbd9fb8e5b88e, 0xcb4ccd500f6bb953},
645 {0xd097ad07a71f26b2, 0x7e2000a41346a7a8},
646 {0x825ecc24c873782f, 0x8ed400668c0c28c9},
647 {0xa2f67f2dfa90563b, 0x728900802f0f32fb},
648 {0xcbb41ef979346bca, 0x4f2b40a03ad2ffba},
649 {0xfea126b7d78186bc, 0xe2f610c84987bfa9},
650 {0x9f24b832e6b0f436, 0x0dd9ca7d2df4d7ca},
651 {0xc6ede63fa05d3143, 0x91503d1c79720dbc},
652 {0xf8a95fcf88747d94, 0x75a44c6397ce912b},
653 {0x9b69dbe1b548ce7c, 0xc986afbe3ee11abb},
654 {0xc24452da229b021b, 0xfbe85badce996169},
655 {0xf2d56790ab41c2a2, 0xfae27299423fb9c4},
656 {0x97c560ba6b0919a5, 0xdccd879fc967d41b},
657 {0xbdb6b8e905cb600f, 0x5400e987bbc1c921},
658 {0xed246723473e3813, 0x290123e9aab23b69},
659 {0x9436c0760c86e30b, 0xf9a0b6720aaf6522},
660 {0xb94470938fa89bce, 0xf808e40e8d5b3e6a},
661 {0xe7958cb87392c2c2, 0xb60b1d1230b20e05},
662 {0x90bd77f3483bb9b9, 0xb1c6f22b5e6f48c3},
663 {0xb4ecd5f01a4aa828, 0x1e38aeb6360b1af4},
664 {0xe2280b6c20dd5232, 0x25c6da63c38de1b1},
665 {0x8d590723948a535f, 0x579c487e5a38ad0f},
666 {0xb0af48ec79ace837, 0x2d835a9df0c6d852},
667 {0xdcdb1b2798182244, 0xf8e431456cf88e66},
668 {0x8a08f0f8bf0f156b, 0x1b8e9ecb641b5900},
669 {0xac8b2d36eed2dac5, 0xe272467e3d222f40},
670 {0xd7adf884aa879177, 0x5b0ed81dcc6abb10},
671 {0x86ccbb52ea94baea, 0x98e947129fc2b4ea},
672 {0xa87fea27a539e9a5, 0x3f2398d747b36225},
673 {0xd29fe4b18e88640e, 0x8eec7f0d19a03aae},
674 {0x83a3eeeef9153e89, 0x1953cf68300424ad},
675 {0xa48ceaaab75a8e2b, 0x5fa8c3423c052dd8},
676 {0xcdb02555653131b6, 0x3792f412cb06794e},
677 {0x808e17555f3ebf11, 0xe2bbd88bbee40bd1},
678 {0xa0b19d2ab70e6ed6, 0x5b6aceaeae9d0ec5},
679 {0xc8de047564d20a8b, 0xf245825a5a445276},
680 {0xfb158592be068d2e, 0xeed6e2f0f0d56713},
681 {0x9ced737bb6c4183d, 0x55464dd69685606c},
682 {0xc428d05aa4751e4c, 0xaa97e14c3c26b887},
683 {0xf53304714d9265df, 0xd53dd99f4b3066a9},
684 {0x993fe2c6d07b7fab, 0xe546a8038efe402a},
685 {0xbf8fdb78849a5f96, 0xde98520472bdd034},
686 {0xef73d256a5c0f77c, 0x963e66858f6d4441},
687 {0x95a8637627989aad, 0xdde7001379a44aa9},
688 {0xbb127c53b17ec159, 0x5560c018580d5d53},
689 {0xe9d71b689dde71af, 0xaab8f01e6e10b4a7},
690 {0x9226712162ab070d, 0xcab3961304ca70e9},
691 {0xb6b00d69bb55c8d1, 0x3d607b97c5fd0d23},
692 {0xe45c10c42a2b3b05, 0x8cb89a7db77c506b},
693 {0x8eb98a7a9a5b04e3, 0x77f3608e92adb243},
694 {0xb267ed1940f1c61c, 0x55f038b237591ed4},
695 {0xdf01e85f912e37a3, 0x6b6c46dec52f6689},
696 {0x8b61313bbabce2c6, 0x2323ac4b3b3da016},
697 {0xae397d8aa96c1b77, 0xabec975e0a0d081b},
698 {0xd9c7dced53c72255, 0x96e7bd358c904a22},
699 {0x881cea14545c7575, 0x7e50d64177da2e55},
700 {0xaa242499697392d2, 0xdde50bd1d5d0b9ea},
701 {0xd4ad2dbfc3d07787, 0x955e4ec64b44e865},
702 {0x84ec3c97da624ab4, 0xbd5af13bef0b113f},
703 {0xa6274bbdd0fadd61, 0xecb1ad8aeacdd58f},
704 {0xcfb11ead453994ba, 0x67de18eda5814af3},
705 {0x81ceb32c4b43fcf4, 0x80eacf948770ced8},
706 {0xa2425ff75e14fc31, 0xa1258379a94d028e},
707 {0xcad2f7f5359a3b3e, 0x096ee45813a04331},
708 {0xfd87b5f28300ca0d, 0x8bca9d6e188853fd},
709 {0x9e74d1b791e07e48, 0x775ea264cf55347e},
710 {0xc612062576589dda, 0x95364afe032a819e},
711 {0xf79687aed3eec551, 0x3a83ddbd83f52205},
712 {0x9abe14cd44753b52, 0xc4926a9672793543},
713 {0xc16d9a0095928a27, 0x75b7053c0f178294},
714 {0xf1c90080baf72cb1, 0x5324c68b12dd6339},
715 {0x971da05074da7bee, 0xd3f6fc16ebca5e04},
716 {0xbce5086492111aea, 0x88f4bb1ca6bcf585},
717 {0xec1e4a7db69561a5, 0x2b31e9e3d06c32e6},
718 {0x9392ee8e921d5d07, 0x3aff322e62439fd0},
719 {0xb877aa3236a4b449, 0x09befeb9fad487c3},
720 {0xe69594bec44de15b, 0x4c2ebe687989a9b4},
721 {0x901d7cf73ab0acd9, 0x0f9d37014bf60a11},
722 {0xb424dc35095cd80f, 0x538484c19ef38c95},
723 {0xe12e13424bb40e13, 0x2865a5f206b06fba},
724 {0x8cbccc096f5088cb, 0xf93f87b7442e45d4},
725 {0xafebff0bcb24aafe, 0xf78f69a51539d749},
726 {0xdbe6fecebdedd5be, 0xb573440e5a884d1c},
727 {0x89705f4136b4a597, 0x31680a88f8953031},
728 {0xabcc77118461cefc, 0xfdc20d2b36ba7c3e},
729 {0xd6bf94d5e57a42bc, 0x3d32907604691b4d},
730 {0x8637bd05af6c69b5, 0xa63f9a49c2c1b110},
731 {0xa7c5ac471b478423, 0x0fcf80dc33721d54},
732 {0xd1b71758e219652b, 0xd3c36113404ea4a9},
733 {0x83126e978d4fdf3b, 0x645a1cac083126ea},
734 {0xa3d70a3d70a3d70a, 0x3d70a3d70a3d70a4},
735 {0xcccccccccccccccc, 0xcccccccccccccccd},
736 {0x8000000000000000, 0x0000000000000000},
737 {0xa000000000000000, 0x0000000000000000},
738 {0xc800000000000000, 0x0000000000000000},
739 {0xfa00000000000000, 0x0000000000000000},
740 {0x9c40000000000000, 0x0000000000000000},
741 {0xc350000000000000, 0x0000000000000000},
742 {0xf424000000000000, 0x0000000000000000},
743 {0x9896800000000000, 0x0000000000000000},
744 {0xbebc200000000000, 0x0000000000000000},
745 {0xee6b280000000000, 0x0000000000000000},
746 {0x9502f90000000000, 0x0000000000000000},
747 {0xba43b74000000000, 0x0000000000000000},
748 {0xe8d4a51000000000, 0x0000000000000000},
749 {0x9184e72a00000000, 0x0000000000000000},
750 {0xb5e620f480000000, 0x0000000000000000},
751 {0xe35fa931a0000000, 0x0000000000000000},
752 {0x8e1bc9bf04000000, 0x0000000000000000},
753 {0xb1a2bc2ec5000000, 0x0000000000000000},
754 {0xde0b6b3a76400000, 0x0000000000000000},
755 {0x8ac7230489e80000, 0x0000000000000000},
756 {0xad78ebc5ac620000, 0x0000000000000000},
757 {0xd8d726b7177a8000, 0x0000000000000000},
758 {0x878678326eac9000, 0x0000000000000000},
759 {0xa968163f0a57b400, 0x0000000000000000},
760 {0xd3c21bcecceda100, 0x0000000000000000},
761 {0x84595161401484a0, 0x0000000000000000},
762 {0xa56fa5b99019a5c8, 0x0000000000000000},
763 {0xcecb8f27f4200f3a, 0x0000000000000000},
764 {0x813f3978f8940984, 0x4000000000000000},
765 {0xa18f07d736b90be5, 0x5000000000000000},
766 {0xc9f2c9cd04674ede, 0xa400000000000000},
767 {0xfc6f7c4045812296, 0x4d00000000000000},
768 {0x9dc5ada82b70b59d, 0xf020000000000000},
769 {0xc5371912364ce305, 0x6c28000000000000},
770 {0xf684df56c3e01bc6, 0xc732000000000000},
771 {0x9a130b963a6c115c, 0x3c7f400000000000},
772 {0xc097ce7bc90715b3, 0x4b9f100000000000},
773 {0xf0bdc21abb48db20, 0x1e86d40000000000},
774 {0x96769950b50d88f4, 0x1314448000000000},
775 {0xbc143fa4e250eb31, 0x17d955a000000000},
776 {0xeb194f8e1ae525fd, 0x5dcfab0800000000},
777 {0x92efd1b8d0cf37be, 0x5aa1cae500000000},
778 {0xb7abc627050305ad, 0xf14a3d9e40000000},
779 {0xe596b7b0c643c719, 0x6d9ccd05d0000000},
780 {0x8f7e32ce7bea5c6f, 0xe4820023a2000000},
781 {0xb35dbf821ae4f38b, 0xdda2802c8a800000},
782 {0xe0352f62a19e306e, 0xd50b2037ad200000},
783 {0x8c213d9da502de45, 0x4526f422cc340000},
784 {0xaf298d050e4395d6, 0x9670b12b7f410000},
785 {0xdaf3f04651d47b4c, 0x3c0cdd765f114000},
786 {0x88d8762bf324cd0f, 0xa5880a69fb6ac800},
787 {0xab0e93b6efee0053, 0x8eea0d047a457a00},
788 {0xd5d238a4abe98068, 0x72a4904598d6d880},
789 {0x85a36366eb71f041, 0x47a6da2b7f864750},
790 {0xa70c3c40a64e6c51, 0x999090b65f67d924},
791 {0xd0cf4b50cfe20765, 0xfff4b4e3f741cf6d},
792 {0x82818f1281ed449f, 0xbff8f10e7a8921a5},
793 {0xa321f2d7226895c7, 0xaff72d52192b6a0e},
794 {0xcbea6f8ceb02bb39, 0x9bf4f8a69f764491},
795 {0xfee50b7025c36a08, 0x02f236d04753d5b5},
796 {0x9f4f2726179a2245, 0x01d762422c946591},
797 {0xc722f0ef9d80aad6, 0x424d3ad2b7b97ef6},
798 {0xf8ebad2b84e0d58b, 0xd2e0898765a7deb3},
799 {0x9b934c3b330c8577, 0x63cc55f49f88eb30},
800 {0xc2781f49ffcfa6d5, 0x3cbf6b71c76b25fc},
801 {0xf316271c7fc3908a, 0x8bef464e3945ef7b},
802 {0x97edd871cfda3a56, 0x97758bf0e3cbb5ad},
803 {0xbde94e8e43d0c8ec, 0x3d52eeed1cbea318},
804 {0xed63a231d4c4fb27, 0x4ca7aaa863ee4bde},
805 {0x945e455f24fb1cf8, 0x8fe8caa93e74ef6b},
806 {0xb975d6b6ee39e436, 0xb3e2fd538e122b45},
807 {0xe7d34c64a9c85d44, 0x60dbbca87196b617},
808 {0x90e40fbeea1d3a4a, 0xbc8955e946fe31ce},
809 {0xb51d13aea4a488dd, 0x6babab6398bdbe42},
810 {0xe264589a4dcdab14, 0xc696963c7eed2dd2},
811 {0x8d7eb76070a08aec, 0xfc1e1de5cf543ca3},
812 {0xb0de65388cc8ada8, 0x3b25a55f43294bcc},
813 {0xdd15fe86affad912, 0x49ef0eb713f39ebf},
814 {0x8a2dbf142dfcc7ab, 0x6e3569326c784338},
815 {0xacb92ed9397bf996, 0x49c2c37f07965405},
816 {0xd7e77a8f87daf7fb, 0xdc33745ec97be907},
817 {0x86f0ac99b4e8dafd, 0x69a028bb3ded71a4},
818 {0xa8acd7c0222311bc, 0xc40832ea0d68ce0d},
819 {0xd2d80db02aabd62b, 0xf50a3fa490c30191},
820 {0x83c7088e1aab65db, 0x792667c6da79e0fb},
821 {0xa4b8cab1a1563f52, 0x577001b891185939},
822 {0xcde6fd5e09abcf26, 0xed4c0226b55e6f87},
823 {0x80b05e5ac60b6178, 0x544f8158315b05b5},
824 {0xa0dc75f1778e39d6, 0x696361ae3db1c722},
825 {0xc913936dd571c84c, 0x03bc3a19cd1e38ea},
826 {0xfb5878494ace3a5f, 0x04ab48a04065c724},
827 {0x9d174b2dcec0e47b, 0x62eb0d64283f9c77},
828 {0xc45d1df942711d9a, 0x3ba5d0bd324f8395},
829 {0xf5746577930d6500, 0xca8f44ec7ee3647a},
830 {0x9968bf6abbe85f20, 0x7e998b13cf4e1ecc},
831 {0xbfc2ef456ae276e8, 0x9e3fedd8c321a67f},
832 {0xefb3ab16c59b14a2, 0xc5cfe94ef3ea101f},
833 {0x95d04aee3b80ece5, 0xbba1f1d158724a13},
834 {0xbb445da9ca61281f, 0x2a8a6e45ae8edc98},
835 {0xea1575143cf97226, 0xf52d09d71a3293be},
836 {0x924d692ca61be758, 0x593c2626705f9c57},
837 {0xb6e0c377cfa2e12e, 0x6f8b2fb00c77836d},
838 {0xe498f455c38b997a, 0x0b6dfb9c0f956448},
839 {0x8edf98b59a373fec, 0x4724bd4189bd5ead},
840 {0xb2977ee300c50fe7, 0x58edec91ec2cb658},
841 {0xdf3d5e9bc0f653e1, 0x2f2967b66737e3ee},
842 {0x8b865b215899f46c, 0xbd79e0d20082ee75},
843 {0xae67f1e9aec07187, 0xecd8590680a3aa12},
844 {0xda01ee641a708de9, 0xe80e6f4820cc9496},
845 {0x884134fe908658b2, 0x3109058d147fdcde},
846 {0xaa51823e34a7eede, 0xbd4b46f0599fd416},
847 {0xd4e5e2cdc1d1ea96, 0x6c9e18ac7007c91b},
848 {0x850fadc09923329e, 0x03e2cf6bc604ddb1},
849 {0xa6539930bf6bff45, 0x84db8346b786151d},
850 {0xcfe87f7cef46ff16, 0xe612641865679a64},
851 {0x81f14fae158c5f6e, 0x4fcb7e8f3f60c07f},
852 {0xa26da3999aef7749, 0xe3be5e330f38f09e},
853 {0xcb090c8001ab551c, 0x5cadf5bfd3072cc6},
854 {0xfdcb4fa002162a63, 0x73d9732fc7c8f7f7},
855 {0x9e9f11c4014dda7e, 0x2867e7fddcdd9afb},
856 {0xc646d63501a1511d, 0xb281e1fd541501b9},
857 {0xf7d88bc24209a565, 0x1f225a7ca91a4227},
858 {0x9ae757596946075f, 0x3375788de9b06959},
859 {0xc1a12d2fc3978937, 0x0052d6b1641c83af},
860 {0xf209787bb47d6b84, 0xc0678c5dbd23a49b},
861 {0x9745eb4d50ce6332, 0xf840b7ba963646e1},
862 {0xbd176620a501fbff, 0xb650e5a93bc3d899},
863 {0xec5d3fa8ce427aff, 0xa3e51f138ab4cebf},
864 {0x93ba47c980e98cdf, 0xc66f336c36b10138},
865 {0xb8a8d9bbe123f017, 0xb80b0047445d4185},
866 {0xe6d3102ad96cec1d, 0xa60dc059157491e6},
867 {0x9043ea1ac7e41392, 0x87c89837ad68db30},
868 {0xb454e4a179dd1877, 0x29babe4598c311fc},
869 {0xe16a1dc9d8545e94, 0xf4296dd6fef3d67b},
870 {0x8ce2529e2734bb1d, 0x1899e4a65f58660d},
871 {0xb01ae745b101e9e4, 0x5ec05dcff72e7f90},
872 {0xdc21a1171d42645d, 0x76707543f4fa1f74},
873 {0x899504ae72497eba, 0x6a06494a791c53a9},
874 {0xabfa45da0edbde69, 0x0487db9d17636893},
875 {0xd6f8d7509292d603, 0x45a9d2845d3c42b7},
876 {0x865b86925b9bc5c2, 0x0b8a2392ba45a9b3},
877 {0xa7f26836f282b732, 0x8e6cac7768d7141f},
878 {0xd1ef0244af2364ff, 0x3207d795430cd927},
879 {0x8335616aed761f1f, 0x7f44e6bd49e807b9},
880 {0xa402b9c5a8d3a6e7, 0x5f16206c9c6209a7},
881 {0xcd036837130890a1, 0x36dba887c37a8c10},
882 {0x802221226be55a64, 0xc2494954da2c978a},
883 {0xa02aa96b06deb0fd, 0xf2db9baa10b7bd6d},
884 {0xc83553c5c8965d3d, 0x6f92829494e5acc8},
885 {0xfa42a8b73abbf48c, 0xcb772339ba1f17fa},
886 {0x9c69a97284b578d7, 0xff2a760414536efc},
887 {0xc38413cf25e2d70d, 0xfef5138519684abb},
888 {0xf46518c2ef5b8cd1, 0x7eb258665fc25d6a},
889 {0x98bf2f79d5993802, 0xef2f773ffbd97a62},
890 {0xbeeefb584aff8603, 0xaafb550ffacfd8fb},
891 {0xeeaaba2e5dbf6784, 0x95ba2a53f983cf39},
892 {0x952ab45cfa97a0b2, 0xdd945a747bf26184},
893 {0xba756174393d88df, 0x94f971119aeef9e5},
894 {0xe912b9d1478ceb17, 0x7a37cd5601aab85e},
895 {0x91abb422ccb812ee, 0xac62e055c10ab33b},
896 {0xb616a12b7fe617aa, 0x577b986b314d600a},
897 {0xe39c49765fdf9d94, 0xed5a7e85fda0b80c},
898 {0x8e41ade9fbebc27d, 0x14588f13be847308},
899 {0xb1d219647ae6b31c, 0x596eb2d8ae258fc9},
900 {0xde469fbd99a05fe3, 0x6fca5f8ed9aef3bc},
901 {0x8aec23d680043bee, 0x25de7bb9480d5855},
902 {0xada72ccc20054ae9, 0xaf561aa79a10ae6b},
903 {0xd910f7ff28069da4, 0x1b2ba1518094da05},
904 {0x87aa9aff79042286, 0x90fb44d2f05d0843},
905 {0xa99541bf57452b28, 0x353a1607ac744a54},
906 {0xd3fa922f2d1675f2, 0x42889b8997915ce9},
907 {0x847c9b5d7c2e09b7, 0x69956135febada12},
908 {0xa59bc234db398c25, 0x43fab9837e699096},
909 {0xcf02b2c21207ef2e, 0x94f967e45e03f4bc},
910 {0x8161afb94b44f57d, 0x1d1be0eebac278f6},
911 {0xa1ba1ba79e1632dc, 0x6462d92a69731733},
912 {0xca28a291859bbf93, 0x7d7b8f7503cfdcff},
913 {0xfcb2cb35e702af78, 0x5cda735244c3d43f},
914 {0x9defbf01b061adab, 0x3a0888136afa64a8},
915 {0xc56baec21c7a1916, 0x088aaa1845b8fdd1},
916 {0xf6c69a72a3989f5b, 0x8aad549e57273d46},
917 {0x9a3c2087a63f6399, 0x36ac54e2f678864c},
918 {0xc0cb28a98fcf3c7f, 0x84576a1bb416a7de},
919 {0xf0fdf2d3f3c30b9f, 0x656d44a2a11c51d6},
920 {0x969eb7c47859e743, 0x9f644ae5a4b1b326},
921 {0xbc4665b596706114, 0x873d5d9f0dde1fef},
922 {0xeb57ff22fc0c7959, 0xa90cb506d155a7eb},
923 {0x9316ff75dd87cbd8, 0x09a7f12442d588f3},
924 {0xb7dcbf5354e9bece, 0x0c11ed6d538aeb30},
925 {0xe5d3ef282a242e81, 0x8f1668c8a86da5fb},
926 {0x8fa475791a569d10, 0xf96e017d694487bd},
927 {0xb38d92d760ec4455, 0x37c981dcc395a9ad},
928 {0xe070f78d3927556a, 0x85bbe253f47b1418},
929 {0x8c469ab843b89562, 0x93956d7478ccec8f},
930 {0xaf58416654a6babb, 0x387ac8d1970027b3},
931 {0xdb2e51bfe9d0696a, 0x06997b05fcc0319f},
932 {0x88fcf317f22241e2, 0x441fece3bdf81f04},
933 {0xab3c2fddeeaad25a, 0xd527e81cad7626c4},
934 {0xd60b3bd56a5586f1, 0x8a71e223d8d3b075},
935 {0x85c7056562757456, 0xf6872d5667844e4a},
936 {0xa738c6bebb12d16c, 0xb428f8ac016561dc},
937 {0xd106f86e69d785c7, 0xe13336d701beba53},
938 {0x82a45b450226b39c, 0xecc0024661173474},
939 {0xa34d721642b06084, 0x27f002d7f95d0191},
940 {0xcc20ce9bd35c78a5, 0x31ec038df7b441f5},
941 {0xff290242c83396ce, 0x7e67047175a15272},
942 {0x9f79a169bd203e41, 0x0f0062c6e984d387},
943 {0xc75809c42c684dd1, 0x52c07b78a3e60869},
944 {0xf92e0c3537826145, 0xa7709a56ccdf8a83},
945 {0x9bbcc7a142b17ccb, 0x88a66076400bb692},
946 {0xc2abf989935ddbfe, 0x6acff893d00ea436},
947 {0xf356f7ebf83552fe, 0x0583f6b8c4124d44},
948 {0x98165af37b2153de, 0xc3727a337a8b704b},
949 {0xbe1bf1b059e9a8d6, 0x744f18c0592e4c5d},
950 {0xeda2ee1c7064130c, 0x1162def06f79df74},
951 {0x9485d4d1c63e8be7, 0x8addcb5645ac2ba9},
952 {0xb9a74a0637ce2ee1, 0x6d953e2bd7173693},
953 {0xe8111c87c5c1ba99, 0xc8fa8db6ccdd0438},
954 {0x910ab1d4db9914a0, 0x1d9c9892400a22a3},
955 {0xb54d5e4a127f59c8, 0x2503beb6d00cab4c},
956 {0xe2a0b5dc971f303a, 0x2e44ae64840fd61e},
957 {0x8da471a9de737e24, 0x5ceaecfed289e5d3},
958 {0xb10d8e1456105dad, 0x7425a83e872c5f48},
959 {0xdd50f1996b947518, 0xd12f124e28f7771a},
960 {0x8a5296ffe33cc92f, 0x82bd6b70d99aaa70},
961 {0xace73cbfdc0bfb7b, 0x636cc64d1001550c},
962 {0xd8210befd30efa5a, 0x3c47f7e05401aa4f},
963 {0x8714a775e3e95c78, 0x65acfaec34810a72},
964 {0xa8d9d1535ce3b396, 0x7f1839a741a14d0e},
965 {0xd31045a8341ca07c, 0x1ede48111209a051},
966 {0x83ea2b892091e44d, 0x934aed0aab460433},
967 {0xa4e4b66b68b65d60, 0xf81da84d56178540},
968 {0xce1de40642e3f4b9, 0x36251260ab9d668f},
969 {0x80d2ae83e9ce78f3, 0xc1d72b7c6b42601a},
970 {0xa1075a24e4421730, 0xb24cf65b8612f820},
971 {0xc94930ae1d529cfc, 0xdee033f26797b628},
972 {0xfb9b7cd9a4a7443c, 0x169840ef017da3b2},
973 {0x9d412e0806e88aa5, 0x8e1f289560ee864f},
974 {0xc491798a08a2ad4e, 0xf1a6f2bab92a27e3},
975 {0xf5b5d7ec8acb58a2, 0xae10af696774b1dc},
976 {0x9991a6f3d6bf1765, 0xacca6da1e0a8ef2a},
977 {0xbff610b0cc6edd3f, 0x17fd090a58d32af4},
978 {0xeff394dcff8a948e, 0xddfc4b4cef07f5b1},
979 {0x95f83d0a1fb69cd9, 0x4abdaf101564f98f},
980 {0xbb764c4ca7a4440f, 0x9d6d1ad41abe37f2},
981 {0xea53df5fd18d5513, 0x84c86189216dc5ee},
982 {0x92746b9be2f8552c, 0x32fd3cf5b4e49bb5},
983 {0xb7118682dbb66a77, 0x3fbc8c33221dc2a2},
984 {0xe4d5e82392a40515, 0x0fabaf3feaa5334b},
985 {0x8f05b1163ba6832d, 0x29cb4d87f2a7400f},
986 {0xb2c71d5bca9023f8, 0x743e20e9ef511013},
987 {0xdf78e4b2bd342cf6, 0x914da9246b255417},
988 {0x8bab8eefb6409c1a, 0x1ad089b6c2f7548f},
989 {0xae9672aba3d0c320, 0xa184ac2473b529b2},
990 {0xda3c0f568cc4f3e8, 0xc9e5d72d90a2741f},
991 {0x8865899617fb1871, 0x7e2fa67c7a658893},
992 {0xaa7eebfb9df9de8d, 0xddbb901b98feeab8},
993 {0xd51ea6fa85785631, 0x552a74227f3ea566},
994 {0x8533285c936b35de, 0xd53a88958f872760},
995 {0xa67ff273b8460356, 0x8a892abaf368f138},
996 {0xd01fef10a657842c, 0x2d2b7569b0432d86},
997 {0x8213f56a67f6b29b, 0x9c3b29620e29fc74},
998 {0xa298f2c501f45f42, 0x8349f3ba91b47b90},
999 {0xcb3f2f7642717713, 0x241c70a936219a74},
1000 {0xfe0efb53d30dd4d7, 0xed238cd383aa0111},
1001 {0x9ec95d1463e8a506, 0xf4363804324a40ab},
1002 {0xc67bb4597ce2ce48, 0xb143c6053edcd0d6},
1003 {0xf81aa16fdc1b81da, 0xdd94b7868e94050b},
1004 {0x9b10a4e5e9913128, 0xca7cf2b4191c8327},
1005 {0xc1d4ce1f63f57d72, 0xfd1c2f611f63a3f1},
1006 {0xf24a01a73cf2dccf, 0xbc633b39673c8ced},
1007 {0x976e41088617ca01, 0xd5be0503e085d814},
1008 {0xbd49d14aa79dbc82, 0x4b2d8644d8a74e19},
1009 {0xec9c459d51852ba2, 0xddf8e7d60ed1219f},
1010 {0x93e1ab8252f33b45, 0xcabb90e5c942b504},
1011 {0xb8da1662e7b00a17, 0x3d6a751f3b936244},
1012 {0xe7109bfba19c0c9d, 0x0cc512670a783ad5},
1013 {0x906a617d450187e2, 0x27fb2b80668b24c6},
1014 {0xb484f9dc9641e9da, 0xb1f9f660802dedf7},
1015 {0xe1a63853bbd26451, 0x5e7873f8a0396974},
1016 {0x8d07e33455637eb2, 0xdb0b487b6423e1e9},
1017 {0xb049dc016abc5e5f, 0x91ce1a9a3d2cda63},
1018 {0xdc5c5301c56b75f7, 0x7641a140cc7810fc},
1019 {0x89b9b3e11b6329ba, 0xa9e904c87fcb0a9e},
1020 {0xac2820d9623bf429, 0x546345fa9fbdcd45},
1021 {0xd732290fbacaf133, 0xa97c177947ad4096},
1022 {0x867f59a9d4bed6c0, 0x49ed8eabcccc485e},
1023 {0xa81f301449ee8c70, 0x5c68f256bfff5a75},
1024 {0xd226fc195c6a2f8c, 0x73832eec6fff3112},
1025 {0x83585d8fd9c25db7, 0xc831fd53c5ff7eac},
1026 {0xa42e74f3d032f525, 0xba3e7ca8b77f5e56},
1027 {0xcd3a1230c43fb26f, 0x28ce1bd2e55f35ec},
1028 {0x80444b5e7aa7cf85, 0x7980d163cf5b81b4},
1029 {0xa0555e361951c366, 0xd7e105bcc3326220},
1030 {0xc86ab5c39fa63440, 0x8dd9472bf3fefaa8},
1031 {0xfa856334878fc150, 0xb14f98f6f0feb952},
1032 {0x9c935e00d4b9d8d2, 0x6ed1bf9a569f33d4},
1033 {0xc3b8358109e84f07, 0x0a862f80ec4700c9},
1034 {0xf4a642e14c6262c8, 0xcd27bb612758c0fb},
1035 {0x98e7e9cccfbd7dbd, 0x8038d51cb897789d},
1036 {0xbf21e44003acdd2c, 0xe0470a63e6bd56c4},
1037 {0xeeea5d5004981478, 0x1858ccfce06cac75},
1038 {0x95527a5202df0ccb, 0x0f37801e0c43ebc9},
1039 {0xbaa718e68396cffd, 0xd30560258f54e6bb},
1040 {0xe950df20247c83fd, 0x47c6b82ef32a206a},
1041 {0x91d28b7416cdd27e, 0x4cdc331d57fa5442},
1042 {0xb6472e511c81471d, 0xe0133fe4adf8e953},
1043 {0xe3d8f9e563a198e5, 0x58180fddd97723a7},
1044 {0x8e679c2f5e44ff8f, 0x570f09eaa7ea7649},
1045 {0xb201833b35d63f73, 0x2cd2cc6551e513db},
1046 {0xde81e40a034bcf4f, 0xf8077f7ea65e58d2},
1047 {0x8b112e86420f6191, 0xfb04afaf27faf783},
1048 {0xadd57a27d29339f6, 0x79c5db9af1f9b564},
1049 {0xd94ad8b1c7380874, 0x18375281ae7822bd},
1050 {0x87cec76f1c830548, 0x8f2293910d0b15b6},
1051 {0xa9c2794ae3a3c69a, 0xb2eb3875504ddb23},
1052 {0xd433179d9c8cb841, 0x5fa60692a46151ec},
1053 {0x849feec281d7f328, 0xdbc7c41ba6bcd334},
1054 {0xa5c7ea73224deff3, 0x12b9b522906c0801},
1055 {0xcf39e50feae16bef, 0xd768226b34870a01},
1056 {0x81842f29f2cce375, 0xe6a1158300d46641},
1057 {0xa1e53af46f801c53, 0x60495ae3c1097fd1},
1058 {0xca5e89b18b602368, 0x385bb19cb14bdfc5},
1059 {0xfcf62c1dee382c42, 0x46729e03dd9ed7b6},
1060 {0x9e19db92b4e31ba9, 0x6c07a2c26a8346d2},
1061 {0xc5a05277621be293, 0xc7098b7305241886},
1062 { 0xf70867153aa2db38,
1063 0xb8cbee4fc66d1ea8 }
1064#else
1065 {0xff77b1fcbebcdc4f, 0x25e8e89c13bb0f7b},
1066 {0xce5d73ff402d98e3, 0xfb0a3d212dc81290},
1067 {0xa6b34ad8c9dfc06f, 0xf42faa48c0ea481f},
1068 {0x86a8d39ef77164bc, 0xae5dff9c02033198},
1069 {0xd98ddaee19068c76, 0x3badd624dd9b0958},
1070 {0xafbd2350644eeacf, 0xe5d1929ef90898fb},
1071 {0x8df5efabc5979c8f, 0xca8d3ffa1ef463c2},
1072 {0xe55990879ddcaabd, 0xcc420a6a101d0516},
1073 {0xb94470938fa89bce, 0xf808e40e8d5b3e6a},
1074 {0x95a8637627989aad, 0xdde7001379a44aa9},
1075 {0xf1c90080baf72cb1, 0x5324c68b12dd6339},
1076 {0xc350000000000000, 0x0000000000000000},
1077 {0x9dc5ada82b70b59d, 0xf020000000000000},
1078 {0xfee50b7025c36a08, 0x02f236d04753d5b5},
1079 {0xcde6fd5e09abcf26, 0xed4c0226b55e6f87},
1080 {0xa6539930bf6bff45, 0x84db8346b786151d},
1081 {0x865b86925b9bc5c2, 0x0b8a2392ba45a9b3},
1082 {0xd910f7ff28069da4, 0x1b2ba1518094da05},
1083 {0xaf58416654a6babb, 0x387ac8d1970027b3},
1084 {0x8da471a9de737e24, 0x5ceaecfed289e5d3},
1085 {0xe4d5e82392a40515, 0x0fabaf3feaa5334b},
1086 {0xb8da1662e7b00a17, 0x3d6a751f3b936244},
1087 { 0x95527a5202df0ccb,
1088 0x0f37801e0c43ebc9 }
1089#endif
1090 };
1091
1092#if FMT_USE_FULL_CACHE_DRAGONBOX
1093 return pow10_significands[k - float_info<double>::min_k];
1094#else
1095 static constexpr const uint64_t powers_of_5_64[] = {
1096 0x0000000000000001, 0x0000000000000005, 0x0000000000000019,
1097 0x000000000000007d, 0x0000000000000271, 0x0000000000000c35,
1098 0x0000000000003d09, 0x000000000001312d, 0x000000000005f5e1,
1099 0x00000000001dcd65, 0x00000000009502f9, 0x0000000002e90edd,
1100 0x000000000e8d4a51, 0x0000000048c27395, 0x000000016bcc41e9,
1101 0x000000071afd498d, 0x0000002386f26fc1, 0x000000b1a2bc2ec5,
1102 0x000003782dace9d9, 0x00001158e460913d, 0x000056bc75e2d631,
1103 0x0001b1ae4d6e2ef5, 0x000878678326eac9, 0x002a5a058fc295ed,
1104 0x00d3c21bcecceda1, 0x0422ca8b0a00a425, 0x14adf4b7320334b9};
1105
1106 static const int compression_ratio = 27;
1107
1108 // Compute base index.
1109 int cache_index = (k - float_info<double>::min_k) / compression_ratio;
1110 int kb = cache_index * compression_ratio + float_info<double>::min_k;
1111 int offset = k - kb;
1112
1113 // Get base cache.
1114 uint128_fallback base_cache = pow10_significands[cache_index];
1115 if (offset == 0)
1116 return base_cache;
1117
1118 // Compute the required amount of bit-shift.
1119 int alpha = floor_log2_pow10(kb + offset) - floor_log2_pow10(kb) - offset;
1120 FMT_ASSERT(alpha > 0 && alpha < 64, "shifting error detected");
1121
1122 // Try to recover the real cache.
1123 uint64_t pow5 = powers_of_5_64[offset];
1124 uint128_fallback recovered_cache = umul128(base_cache.high(), pow5);
1125 uint128_fallback middle_low = umul128(base_cache.low(), pow5);
1126
1127 recovered_cache += middle_low.high();
1128
1129 uint64_t high_to_middle = recovered_cache.high() << (64 - alpha);
1130 uint64_t middle_to_low = recovered_cache.low() << (64 - alpha);
1131
1132 recovered_cache =
1133 uint128_fallback{(recovered_cache.low() >> alpha) | high_to_middle,
1134 ((middle_low.low() >> alpha) | middle_to_low)};
1135 FMT_ASSERT(recovered_cache.low() + 1 != 0, "");
1136 return {recovered_cache.high(), recovered_cache.low() + 1};
1137#endif
1138 }
1139
1140 struct compute_mul_result
1141 {
1144 };
1145 struct compute_mul_parity_result
1146 {
1149 };
1150
1151 static compute_mul_result compute_mul(
1152 carrier_uint u, const cache_entry_type& cache) noexcept
1153 {
1154 auto r = umul192_upper128(u, cache);
1155 return {r.high(), r.low() == 0};
1156 }
1157
1158 static uint32_t compute_delta(cache_entry_type const& cache,
1159 int beta) noexcept
1160 {
1161 return static_cast<uint32_t>(cache.high() >> (64 - 1 - beta));
1162 }
1163
1164 static compute_mul_parity_result compute_mul_parity(
1165 carrier_uint two_f, const cache_entry_type& cache, int beta) noexcept
1166 {
1167 FMT_ASSERT(beta >= 1, "");
1168 FMT_ASSERT(beta < 64, "");
1169
1170 auto r = umul192_lower128(two_f, cache);
1171 return {((r.high() >> (64 - beta)) & 1) != 0,
1172 ((r.high() << beta) | (r.low() >> (64 - beta))) == 0};
1173 }
1174
1176 const cache_entry_type& cache, int beta) noexcept
1177 {
1178 return (cache.high() -
1179 (cache.high() >> (num_significand_bits<double>() + 2))) >>
1180 (64 - num_significand_bits<double>() - 1 - beta);
1181 }
1182
1184 const cache_entry_type& cache, int beta) noexcept
1185 {
1186 return (cache.high() +
1187 (cache.high() >> (num_significand_bits<double>() + 1))) >>
1188 (64 - num_significand_bits<double>() - 1 - beta);
1189 }
1190
1192 const cache_entry_type& cache, int beta) noexcept
1193 {
1194 return ((cache.high() >> (64 - num_significand_bits<double>() - 2 - beta)) +
1195 1) /
1196 2;
1197 }
1198 };
1199
1200 // Various integer checks
1201 template <class T>
1203 {
1204 const int case_shorter_interval_left_endpoint_lower_threshold = 2;
1205 const int case_shorter_interval_left_endpoint_upper_threshold = 3;
1206 return exponent >= case_shorter_interval_left_endpoint_lower_threshold &&
1207 exponent <= case_shorter_interval_left_endpoint_upper_threshold;
1208 }
1209
1210 // Remove trailing zeros from n and return the number of zeros removed (float)
1211 FMT_INLINE int remove_trailing_zeros(uint32_t& n) noexcept
1212 {
1213 FMT_ASSERT(n != 0, "");
1214 const uint32_t mod_inv_5 = 0xcccccccd;
1215 const uint32_t mod_inv_25 = mod_inv_5 * mod_inv_5;
1216
1217 int s = 0;
1218 while (true)
1219 {
1220 auto q = rotr(n * mod_inv_25, 2);
1221 if (q > max_value<uint32_t>() / 100)
1222 break;
1223 n = q;
1224 s += 2;
1225 }
1226 auto q = rotr(n * mod_inv_5, 1);
1227 if (q <= max_value<uint32_t>() / 10)
1228 {
1229 n = q;
1230 s |= 1;
1231 }
1232
1233 return s;
1234 }
1235
1236 // Removes trailing zeros and returns the number of zeros removed (double)
1237 FMT_INLINE int remove_trailing_zeros(uint64_t& n) noexcept
1238 {
1239 FMT_ASSERT(n != 0, "");
1240
1241 // This magic number is ceil(2^90 / 10^8).
1242 constexpr uint64_t magic_number = 12379400392853802749ull;
1243 auto nm = umul128(n, magic_number);
1244
1245 // Is n is divisible by 10^8?
1246 if ((nm.high() & ((1ull << (90 - 64)) - 1)) == 0 && nm.low() < magic_number)
1247 {
1248 // If yes, work with the quotient.
1249 auto n32 = static_cast<uint32_t>(nm.high() >> (90 - 64));
1250
1251 const uint32_t mod_inv_5 = 0xcccccccd;
1252 const uint32_t mod_inv_25 = mod_inv_5 * mod_inv_5;
1253
1254 int s = 8;
1255 while (true)
1256 {
1257 auto q = rotr(n32 * mod_inv_25, 2);
1258 if (q > max_value<uint32_t>() / 100)
1259 break;
1260 n32 = q;
1261 s += 2;
1262 }
1263 auto q = rotr(n32 * mod_inv_5, 1);
1264 if (q <= max_value<uint32_t>() / 10)
1265 {
1266 n32 = q;
1267 s |= 1;
1268 }
1269
1270 n = n32;
1271 return s;
1272 }
1273
1274 // If n is not divisible by 10^8, work with n itself.
1275 const uint64_t mod_inv_5 = 0xcccccccccccccccd;
1276
1277 /* what the fuck */
1278 const uint64_t mod_inv_25 = mod_inv_5 * mod_inv_5;
1279
1280 int s = 0;
1281 while (true)
1282 {
1283 auto q = rotr(n * mod_inv_25, 2);
1284 if (q > max_value<uint64_t>() / 100)
1285 break;
1286 n = q;
1287 s += 2;
1288 }
1289 auto q = rotr(n * mod_inv_5, 1);
1290 if (q <= max_value<uint64_t>() / 10)
1291 {
1292 n = q;
1293 s |= 1;
1294 }
1295
1296 return s;
1297 }
1298
1299 // The main algorithm for shorter interval case
1300 template <class T>
1301 FMT_INLINE decimal_fp<T> shorter_interval_case(int exponent) noexcept
1302 {
1303 decimal_fp<T> ret_value;
1304 // Compute k and beta
1305 const int minus_k = floor_log10_pow2_minus_log10_4_over_3(exponent);
1306 const int beta = exponent + floor_log2_pow10(-minus_k);
1307
1308 // Compute xi and zi
1309 using cache_entry_type = typename cache_accessor<T>::cache_entry_type;
1310 const cache_entry_type cache = cache_accessor<T>::get_cached_power(-minus_k);
1311
1313 cache, beta);
1315 cache, beta);
1316
1317 // If the left endpoint is not an integer, increase it
1318 if (!is_left_endpoint_integer_shorter_interval<T>(exponent))
1319 ++xi;
1320
1321 // Try bigger divisor
1322 ret_value.significand = zi / 10;
1323
1324 // If succeed, remove trailing zeros if necessary and return
1325 if (ret_value.significand * 10 >= xi)
1326 {
1327 ret_value.exponent = minus_k + 1;
1328 ret_value.exponent += remove_trailing_zeros(ret_value.significand);
1329 return ret_value;
1330 }
1331
1332 // Otherwise, compute the round-up of y
1333 ret_value.significand =
1335 beta);
1336 ret_value.exponent = minus_k;
1337
1338 // When tie occurs, choose one of them according to the rule
1339 if (exponent >= float_info<T>::shorter_interval_tie_lower_threshold &&
1340 exponent <= float_info<T>::shorter_interval_tie_upper_threshold)
1341 {
1342 ret_value.significand = ret_value.significand % 2 == 0
1343 ? ret_value.significand
1344 : ret_value.significand - 1;
1345 }
1346 else if (ret_value.significand < xi)
1347 {
1348 ++ret_value.significand;
1349 }
1350 return ret_value;
1351 }
1352
1353 template <typename T>
1354 decimal_fp<T> to_decimal(T x) noexcept
1355 {
1356 // Step 1: integer promotion & Schubfach multiplier calculation.
1357
1358 using carrier_uint = typename float_info<T>::carrier_uint;
1359 using cache_entry_type = typename cache_accessor<T>::cache_entry_type;
1360 auto br = bit_cast<carrier_uint>(x);
1361
1362 // Extract significand bits and exponent bits.
1363 const carrier_uint significand_mask =
1364 (static_cast<carrier_uint>(1) << num_significand_bits<T>()) - 1;
1365 carrier_uint significand = (br & significand_mask);
1366 int exponent =
1367 static_cast<int>((br & exponent_mask<T>()) >> num_significand_bits<T>());
1368
1369 if (exponent != 0)
1370 { // Check if normal.
1371 exponent -= exponent_bias<T>() + num_significand_bits<T>();
1372
1373 // Shorter interval case; proceed like Schubfach.
1374 // In fact, when exponent == 1 and significand == 0, the interval is
1375 // regular. However, it can be shown that the end-results are anyway same.
1376 if (significand == 0)
1377 return shorter_interval_case<T>(exponent);
1378
1379 significand |= (static_cast<carrier_uint>(1) << num_significand_bits<T>());
1380 }
1381 else
1382 {
1383 // Subnormal case; the interval is always regular.
1384 if (significand == 0)
1385 return {0, 0};
1386 exponent =
1387 std::numeric_limits<T>::min_exponent - num_significand_bits<T>() - 1;
1388 }
1389
1390 const bool include_left_endpoint = (significand % 2 == 0);
1391 const bool include_right_endpoint = include_left_endpoint;
1392
1393 // Compute k and beta.
1394 const int minus_k = floor_log10_pow2(exponent) - float_info<T>::kappa;
1395 const cache_entry_type cache = cache_accessor<T>::get_cached_power(-minus_k);
1396 const int beta = exponent + floor_log2_pow10(-minus_k);
1397
1398 // Compute zi and deltai.
1399 // 10^kappa <= deltai < 10^(kappa + 1)
1400 const uint32_t deltai = cache_accessor<T>::compute_delta(cache, beta);
1401 const carrier_uint two_fc = significand << 1;
1402
1403 // For the case of binary32, the result of integer check is not correct for
1404 // 29711844 * 2^-82
1405 // = 6.1442653300000000008655037797566933477355632930994033813476... * 10^-18
1406 // and 29711844 * 2^-81
1407 // = 1.2288530660000000001731007559513386695471126586198806762695... * 10^-17,
1408 // and they are the unique counterexamples. However, since 29711844 is even,
1409 // this does not cause any problem for the endpoints calculations; it can only
1410 // cause a problem when we need to perform integer check for the center.
1411 // Fortunately, with these inputs, that branch is never executed, so we are
1412 // fine.
1413 const typename cache_accessor<T>::compute_mul_result z_mul =
1414 cache_accessor<T>::compute_mul((two_fc | 1) << beta, cache);
1415
1416 // Step 2: Try larger divisor; remove trailing zeros if necessary.
1417
1418 // Using an upper bound on zi, we might be able to optimize the division
1419 // better than the compiler; we are computing zi / big_divisor here.
1420 decimal_fp<T> ret_value;
1421 ret_value.significand = divide_by_10_to_kappa_plus_1(z_mul.result);
1422 uint32_t r = static_cast<uint32_t>(z_mul.result - float_info<T>::big_divisor *
1423 ret_value.significand);
1424
1425 if (r < deltai)
1426 {
1427 // Exclude the right endpoint if necessary.
1428 if (r == 0 && (z_mul.is_integer & !include_right_endpoint))
1429 {
1430 --ret_value.significand;
1431 r = float_info<T>::big_divisor;
1432 goto small_divisor_case_label;
1433 }
1434 }
1435 else if (r > deltai)
1436 {
1437 goto small_divisor_case_label;
1438 }
1439 else
1440 {
1441 // r == deltai; compare fractional parts.
1443 cache_accessor<T>::compute_mul_parity(two_fc - 1, cache, beta);
1444
1445 if (!(x_mul.parity | (x_mul.is_integer & include_left_endpoint)))
1446 goto small_divisor_case_label;
1447 }
1448 ret_value.exponent = minus_k + float_info<T>::kappa + 1;
1449
1450 // We may need to remove trailing zeros.
1451 ret_value.exponent += remove_trailing_zeros(ret_value.significand);
1452 return ret_value;
1453
1454 // Step 3: Find the significand with the smaller divisor.
1455
1456 small_divisor_case_label:
1457 ret_value.significand *= 10;
1458 ret_value.exponent = minus_k + float_info<T>::kappa;
1459
1460 uint32_t dist = r - (deltai / 2) + (float_info<T>::small_divisor / 2);
1461 const bool approx_y_parity =
1462 ((dist ^ (float_info<T>::small_divisor / 2)) & 1) != 0;
1463
1464 // Is dist divisible by 10^kappa?
1465 const bool divisible_by_small_divisor =
1466 check_divisibility_and_divide_by_pow10<float_info<T>::kappa>(dist);
1467
1468 // Add dist / 10^kappa to the significand.
1469 ret_value.significand += dist;
1470
1471 if (!divisible_by_small_divisor)
1472 return ret_value;
1473
1474 // Check z^(f) >= epsilon^(f).
1475 // We have either yi == zi - epsiloni or yi == (zi - epsiloni) - 1,
1476 // where yi == zi - epsiloni if and only if z^(f) >= epsilon^(f).
1477 // Since there are only 2 possibilities, we only need to care about the
1478 // parity. Also, zi and r should have the same parity since the divisor
1479 // is an even number.
1480 const auto y_mul = cache_accessor<T>::compute_mul_parity(two_fc, cache, beta);
1481
1482 // If z^(f) >= epsilon^(f), we might have a tie when z^(f) == epsilon^(f),
1483 // or equivalently, when y is an integer.
1484 if (y_mul.parity != approx_y_parity)
1485 --ret_value.significand;
1486 else if (y_mul.is_integer & (ret_value.significand % 2 != 0))
1487 --ret_value.significand;
1488 return ret_value;
1489 }
1490 } // namespace dragonbox
1491
1492#ifdef _MSC_VER
1493 FMT_FUNC auto fmt_snprintf(char* buf, size_t size, const char* fmt, ...)
1494 -> int
1495 {
1496 auto args = va_list();
1497 va_start(args, fmt);
1498 int result = vsnprintf_s(buf, size, _TRUNCATE, fmt, args);
1499 va_end(args);
1500 return result;
1501 }
1502#endif
1503} // namespace detail
1504
1505template <>
1507{
1509 -> format_parse_context::iterator
1510 {
1511 return ctx.begin();
1512 }
1513
1514 template <typename FormatContext>
1515 auto format(const detail::bigint& n, FormatContext& ctx) const ->
1516 typename FormatContext::iterator
1517 {
1518 auto out = ctx.out();
1519 bool first = true;
1520 for (auto i = n.bigits_.size(); i > 0; --i)
1521 {
1522 auto value = n.bigits_[i - 1u];
1523 if (first)
1524 {
1525 out = format_to(out, FMT_STRING("{:x}"), value);
1526 first = false;
1527 continue;
1528 }
1529 out = format_to(out, FMT_STRING("{:08x}"), value);
1530 }
1531 if (n.exp_ > 0)
1532 out = format_to(out, FMT_STRING("p{}"),
1533 n.exp_ * detail::bigint::bigit_bits);
1534 return out;
1535 }
1536};
1537
1538FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s)
1539{
1540 for_each_codepoint(s, [this](uint32_t cp, string_view) {
1541 if (cp == invalid_code_point)
1542 FMT_THROW(std::runtime_error("invalid utf8"));
1543 if (cp <= 0xFFFF)
1544 {
1545 buffer_.push_back(static_cast<wchar_t>(cp));
1546 }
1547 else
1548 {
1549 cp -= 0x10000;
1550 buffer_.push_back(static_cast<wchar_t>(0xD800 + (cp >> 10)));
1551 buffer_.push_back(static_cast<wchar_t>(0xDC00 + (cp & 0x3FF)));
1552 }
1553 return true;
1554 });
1555 buffer_.push_back(0);
1556}
1557
1558FMT_FUNC void format_system_error(detail::buffer<char>& out, int error_code, const char* message) noexcept
1559{
1560 FMT_TRY
1561 {
1562 auto ec = std::error_code(error_code, std::generic_category());
1563 write(std::back_inserter(out), std::system_error(ec, message).what());
1564 return;
1565 }
1566 FMT_CATCH(...)
1567 {
1568 }
1569 format_error_code(out, error_code, message);
1570}
1571
1572FMT_FUNC void report_system_error(int error_code,
1573 const char* message) noexcept
1574{
1575 report_error(format_system_error, error_code, message);
1576}
1577
1579{
1580 // Don't optimize the "{}" case to keep the binary size small and because it
1581 // can be better optimized in fmt::format anyway.
1582 auto buffer = memory_buffer();
1583 detail::vformat_to(buffer, fmt, args);
1584 return to_string(buffer);
1585}
1586
1587namespace detail
1588{
1589#ifdef _WIN32
1590 using dword = conditional_t<sizeof(long) == 4, unsigned long, unsigned>;
1591 extern "C" __declspec(dllimport) int __stdcall WriteConsoleW( //
1592 void*,
1593 const void*,
1594 dword,
1595 dword*,
1596 void*);
1597
1598 FMT_FUNC bool write_console(std::FILE* f, string_view text)
1599 {
1600 auto fd = _fileno(f);
1601 if (_isatty(fd))
1602 {
1603 detail::utf8_to_utf16 u16(string_view(text.data(), text.size()));
1604 auto written = detail::dword();
1605 if (detail::WriteConsoleW(reinterpret_cast<void*>(_get_osfhandle(fd)),
1606 u16.c_str(), static_cast<uint32_t>(u16.size()),
1607 &written, nullptr))
1608 {
1609 return true;
1610 }
1611 }
1612 // We return false if the file descriptor was not TTY, or it was but
1613 // SetConsoleW failed which can happen if the output has been redirected to
1614 // NUL. In both cases when we return false, we should attempt to do regular
1615 // write via fwrite or std::ostream::write.
1616 return false;
1617 }
1618#endif
1619
1620 FMT_FUNC void print(std::FILE* f, string_view text)
1621 {
1622#ifdef _WIN32
1623 if (write_console(f, text))
1624 return;
1625#endif
1626 detail::fwrite_fully(text.data(), 1, text.size(), f);
1627 }
1628} // namespace detail
1629
1630FMT_FUNC void vprint(std::FILE* f, string_view format_str, format_args args)
1631{
1633 detail::vformat_to(buffer, format_str, args);
1634 detail::print(f, {buffer.data(), buffer.size()});
1635}
1636
1637#ifdef _WIN32
1638// Print assuming legacy (non-Unicode) encoding.
1639FMT_FUNC void detail::vprint_mojibake(std::FILE* f, string_view format_str, format_args args)
1640{
1642 detail::vformat_to(buffer, format_str,
1644 fwrite_fully(buffer.data(), 1, buffer.size(), f);
1645}
1646#endif
1647
1649{
1650 vprint(stdout, format_str, args);
1651}
1652
1653namespace detail
1654{
1655
1657 {
1658 unsigned char upper;
1659 unsigned char lower_count;
1660 };
1661
1662 inline auto is_printable(uint16_t x, const singleton* singletons, size_t singletons_size, const unsigned char* singleton_lowers, const unsigned char* normal, size_t normal_size)
1663 -> bool
1664 {
1665 auto upper = x >> 8;
1666 auto lower_start = 0;
1667 for (size_t i = 0; i < singletons_size; ++i)
1668 {
1669 auto s = singletons[i];
1670 auto lower_end = lower_start + s.lower_count;
1671 if (upper < s.upper)
1672 break;
1673 if (upper == s.upper)
1674 {
1675 for (auto j = lower_start; j < lower_end; ++j)
1676 {
1677 if (singleton_lowers[j] == (x & 0xff))
1678 return false;
1679 }
1680 }
1681 lower_start = lower_end;
1682 }
1683
1684 auto xsigned = static_cast<int>(x);
1685 auto current = true;
1686 for (size_t i = 0; i < normal_size; ++i)
1687 {
1688 auto v = static_cast<int>(normal[i]);
1689 auto len = (v & 0x80) != 0 ? (v & 0x7f) << 8 | normal[++i] : v;
1690 xsigned -= len;
1691 if (xsigned < 0)
1692 break;
1693 current = !current;
1694 }
1695 return current;
1696 }
1697
1698 // This code is generated by support/printable.py.
1699 FMT_FUNC auto is_printable(uint32_t cp) -> bool
1700 {
1701 static constexpr singleton singletons0[] = {
1702 {0x00, 1},
1703 {0x03, 5},
1704 {0x05, 6},
1705 {0x06, 3},
1706 {0x07, 6},
1707 {0x08, 8},
1708 {0x09, 17},
1709 {0x0a, 28},
1710 {0x0b, 25},
1711 {0x0c, 20},
1712 {0x0d, 16},
1713 {0x0e, 13},
1714 {0x0f, 4},
1715 {0x10, 3},
1716 {0x12, 18},
1717 {0x13, 9},
1718 {0x16, 1},
1719 {0x17, 5},
1720 {0x18, 2},
1721 {0x19, 3},
1722 {0x1a, 7},
1723 {0x1c, 2},
1724 {0x1d, 1},
1725 {0x1f, 22},
1726 {0x20, 3},
1727 {0x2b, 3},
1728 {0x2c, 2},
1729 {0x2d, 11},
1730 {0x2e, 1},
1731 {0x30, 3},
1732 {0x31, 2},
1733 {0x32, 1},
1734 {0xa7, 2},
1735 {0xa9, 2},
1736 {0xaa, 4},
1737 {0xab, 8},
1738 {0xfa, 2},
1739 {0xfb, 5},
1740 {0xfd, 4},
1741 {0xfe, 3},
1742 {0xff, 9},
1743 };
1744 static constexpr unsigned char singletons0_lower[] = {
1745 0xad,
1746 0x78,
1747 0x79,
1748 0x8b,
1749 0x8d,
1750 0xa2,
1751 0x30,
1752 0x57,
1753 0x58,
1754 0x8b,
1755 0x8c,
1756 0x90,
1757 0x1c,
1758 0x1d,
1759 0xdd,
1760 0x0e,
1761 0x0f,
1762 0x4b,
1763 0x4c,
1764 0xfb,
1765 0xfc,
1766 0x2e,
1767 0x2f,
1768 0x3f,
1769 0x5c,
1770 0x5d,
1771 0x5f,
1772 0xb5,
1773 0xe2,
1774 0x84,
1775 0x8d,
1776 0x8e,
1777 0x91,
1778 0x92,
1779 0xa9,
1780 0xb1,
1781 0xba,
1782 0xbb,
1783 0xc5,
1784 0xc6,
1785 0xc9,
1786 0xca,
1787 0xde,
1788 0xe4,
1789 0xe5,
1790 0xff,
1791 0x00,
1792 0x04,
1793 0x11,
1794 0x12,
1795 0x29,
1796 0x31,
1797 0x34,
1798 0x37,
1799 0x3a,
1800 0x3b,
1801 0x3d,
1802 0x49,
1803 0x4a,
1804 0x5d,
1805 0x84,
1806 0x8e,
1807 0x92,
1808 0xa9,
1809 0xb1,
1810 0xb4,
1811 0xba,
1812 0xbb,
1813 0xc6,
1814 0xca,
1815 0xce,
1816 0xcf,
1817 0xe4,
1818 0xe5,
1819 0x00,
1820 0x04,
1821 0x0d,
1822 0x0e,
1823 0x11,
1824 0x12,
1825 0x29,
1826 0x31,
1827 0x34,
1828 0x3a,
1829 0x3b,
1830 0x45,
1831 0x46,
1832 0x49,
1833 0x4a,
1834 0x5e,
1835 0x64,
1836 0x65,
1837 0x84,
1838 0x91,
1839 0x9b,
1840 0x9d,
1841 0xc9,
1842 0xce,
1843 0xcf,
1844 0x0d,
1845 0x11,
1846 0x29,
1847 0x45,
1848 0x49,
1849 0x57,
1850 0x64,
1851 0x65,
1852 0x8d,
1853 0x91,
1854 0xa9,
1855 0xb4,
1856 0xba,
1857 0xbb,
1858 0xc5,
1859 0xc9,
1860 0xdf,
1861 0xe4,
1862 0xe5,
1863 0xf0,
1864 0x0d,
1865 0x11,
1866 0x45,
1867 0x49,
1868 0x64,
1869 0x65,
1870 0x80,
1871 0x84,
1872 0xb2,
1873 0xbc,
1874 0xbe,
1875 0xbf,
1876 0xd5,
1877 0xd7,
1878 0xf0,
1879 0xf1,
1880 0x83,
1881 0x85,
1882 0x8b,
1883 0xa4,
1884 0xa6,
1885 0xbe,
1886 0xbf,
1887 0xc5,
1888 0xc7,
1889 0xce,
1890 0xcf,
1891 0xda,
1892 0xdb,
1893 0x48,
1894 0x98,
1895 0xbd,
1896 0xcd,
1897 0xc6,
1898 0xce,
1899 0xcf,
1900 0x49,
1901 0x4e,
1902 0x4f,
1903 0x57,
1904 0x59,
1905 0x5e,
1906 0x5f,
1907 0x89,
1908 0x8e,
1909 0x8f,
1910 0xb1,
1911 0xb6,
1912 0xb7,
1913 0xbf,
1914 0xc1,
1915 0xc6,
1916 0xc7,
1917 0xd7,
1918 0x11,
1919 0x16,
1920 0x17,
1921 0x5b,
1922 0x5c,
1923 0xf6,
1924 0xf7,
1925 0xfe,
1926 0xff,
1927 0x80,
1928 0x0d,
1929 0x6d,
1930 0x71,
1931 0xde,
1932 0xdf,
1933 0x0e,
1934 0x0f,
1935 0x1f,
1936 0x6e,
1937 0x6f,
1938 0x1c,
1939 0x1d,
1940 0x5f,
1941 0x7d,
1942 0x7e,
1943 0xae,
1944 0xaf,
1945 0xbb,
1946 0xbc,
1947 0xfa,
1948 0x16,
1949 0x17,
1950 0x1e,
1951 0x1f,
1952 0x46,
1953 0x47,
1954 0x4e,
1955 0x4f,
1956 0x58,
1957 0x5a,
1958 0x5c,
1959 0x5e,
1960 0x7e,
1961 0x7f,
1962 0xb5,
1963 0xc5,
1964 0xd4,
1965 0xd5,
1966 0xdc,
1967 0xf0,
1968 0xf1,
1969 0xf5,
1970 0x72,
1971 0x73,
1972 0x8f,
1973 0x74,
1974 0x75,
1975 0x96,
1976 0x2f,
1977 0x5f,
1978 0x26,
1979 0x2e,
1980 0x2f,
1981 0xa7,
1982 0xaf,
1983 0xb7,
1984 0xbf,
1985 0xc7,
1986 0xcf,
1987 0xd7,
1988 0xdf,
1989 0x9a,
1990 0x40,
1991 0x97,
1992 0x98,
1993 0x30,
1994 0x8f,
1995 0x1f,
1996 0xc0,
1997 0xc1,
1998 0xce,
1999 0xff,
2000 0x4e,
2001 0x4f,
2002 0x5a,
2003 0x5b,
2004 0x07,
2005 0x08,
2006 0x0f,
2007 0x10,
2008 0x27,
2009 0x2f,
2010 0xee,
2011 0xef,
2012 0x6e,
2013 0x6f,
2014 0x37,
2015 0x3d,
2016 0x3f,
2017 0x42,
2018 0x45,
2019 0x90,
2020 0x91,
2021 0xfe,
2022 0xff,
2023 0x53,
2024 0x67,
2025 0x75,
2026 0xc8,
2027 0xc9,
2028 0xd0,
2029 0xd1,
2030 0xd8,
2031 0xd9,
2032 0xe7,
2033 0xfe,
2034 0xff,
2035 };
2036 static constexpr singleton singletons1[] = {
2037 {0x00, 6},
2038 {0x01, 1},
2039 {0x03, 1},
2040 {0x04, 2},
2041 {0x08, 8},
2042 {0x09, 2},
2043 {0x0a, 5},
2044 {0x0b, 2},
2045 {0x0e, 4},
2046 {0x10, 1},
2047 {0x11, 2},
2048 {0x12, 5},
2049 {0x13, 17},
2050 {0x14, 1},
2051 {0x15, 2},
2052 {0x17, 2},
2053 {0x19, 13},
2054 {0x1c, 5},
2055 {0x1d, 8},
2056 {0x24, 1},
2057 {0x6a, 3},
2058 {0x6b, 2},
2059 {0xbc, 2},
2060 {0xd1, 2},
2061 {0xd4, 12},
2062 {0xd5, 9},
2063 {0xd6, 2},
2064 {0xd7, 2},
2065 {0xda, 1},
2066 {0xe0, 5},
2067 {0xe1, 2},
2068 {0xe8, 2},
2069 {0xee, 32},
2070 {0xf0, 4},
2071 {0xf8, 2},
2072 {0xf9, 2},
2073 {0xfa, 2},
2074 {0xfb, 1},
2075 };
2076 static constexpr unsigned char singletons1_lower[] = {
2077 0x0c,
2078 0x27,
2079 0x3b,
2080 0x3e,
2081 0x4e,
2082 0x4f,
2083 0x8f,
2084 0x9e,
2085 0x9e,
2086 0x9f,
2087 0x06,
2088 0x07,
2089 0x09,
2090 0x36,
2091 0x3d,
2092 0x3e,
2093 0x56,
2094 0xf3,
2095 0xd0,
2096 0xd1,
2097 0x04,
2098 0x14,
2099 0x18,
2100 0x36,
2101 0x37,
2102 0x56,
2103 0x57,
2104 0x7f,
2105 0xaa,
2106 0xae,
2107 0xaf,
2108 0xbd,
2109 0x35,
2110 0xe0,
2111 0x12,
2112 0x87,
2113 0x89,
2114 0x8e,
2115 0x9e,
2116 0x04,
2117 0x0d,
2118 0x0e,
2119 0x11,
2120 0x12,
2121 0x29,
2122 0x31,
2123 0x34,
2124 0x3a,
2125 0x45,
2126 0x46,
2127 0x49,
2128 0x4a,
2129 0x4e,
2130 0x4f,
2131 0x64,
2132 0x65,
2133 0x5c,
2134 0xb6,
2135 0xb7,
2136 0x1b,
2137 0x1c,
2138 0x07,
2139 0x08,
2140 0x0a,
2141 0x0b,
2142 0x14,
2143 0x17,
2144 0x36,
2145 0x39,
2146 0x3a,
2147 0xa8,
2148 0xa9,
2149 0xd8,
2150 0xd9,
2151 0x09,
2152 0x37,
2153 0x90,
2154 0x91,
2155 0xa8,
2156 0x07,
2157 0x0a,
2158 0x3b,
2159 0x3e,
2160 0x66,
2161 0x69,
2162 0x8f,
2163 0x92,
2164 0x6f,
2165 0x5f,
2166 0xee,
2167 0xef,
2168 0x5a,
2169 0x62,
2170 0x9a,
2171 0x9b,
2172 0x27,
2173 0x28,
2174 0x55,
2175 0x9d,
2176 0xa0,
2177 0xa1,
2178 0xa3,
2179 0xa4,
2180 0xa7,
2181 0xa8,
2182 0xad,
2183 0xba,
2184 0xbc,
2185 0xc4,
2186 0x06,
2187 0x0b,
2188 0x0c,
2189 0x15,
2190 0x1d,
2191 0x3a,
2192 0x3f,
2193 0x45,
2194 0x51,
2195 0xa6,
2196 0xa7,
2197 0xcc,
2198 0xcd,
2199 0xa0,
2200 0x07,
2201 0x19,
2202 0x1a,
2203 0x22,
2204 0x25,
2205 0x3e,
2206 0x3f,
2207 0xc5,
2208 0xc6,
2209 0x04,
2210 0x20,
2211 0x23,
2212 0x25,
2213 0x26,
2214 0x28,
2215 0x33,
2216 0x38,
2217 0x3a,
2218 0x48,
2219 0x4a,
2220 0x4c,
2221 0x50,
2222 0x53,
2223 0x55,
2224 0x56,
2225 0x58,
2226 0x5a,
2227 0x5c,
2228 0x5e,
2229 0x60,
2230 0x63,
2231 0x65,
2232 0x66,
2233 0x6b,
2234 0x73,
2235 0x78,
2236 0x7d,
2237 0x7f,
2238 0x8a,
2239 0xa4,
2240 0xaa,
2241 0xaf,
2242 0xb0,
2243 0xc0,
2244 0xd0,
2245 0xae,
2246 0xaf,
2247 0x79,
2248 0xcc,
2249 0x6e,
2250 0x6f,
2251 0x93,
2252 };
2253 static constexpr unsigned char normal0[] = {
2254 0x00,
2255 0x20,
2256 0x5f,
2257 0x22,
2258 0x82,
2259 0xdf,
2260 0x04,
2261 0x82,
2262 0x44,
2263 0x08,
2264 0x1b,
2265 0x04,
2266 0x06,
2267 0x11,
2268 0x81,
2269 0xac,
2270 0x0e,
2271 0x80,
2272 0xab,
2273 0x35,
2274 0x28,
2275 0x0b,
2276 0x80,
2277 0xe0,
2278 0x03,
2279 0x19,
2280 0x08,
2281 0x01,
2282 0x04,
2283 0x2f,
2284 0x04,
2285 0x34,
2286 0x04,
2287 0x07,
2288 0x03,
2289 0x01,
2290 0x07,
2291 0x06,
2292 0x07,
2293 0x11,
2294 0x0a,
2295 0x50,
2296 0x0f,
2297 0x12,
2298 0x07,
2299 0x55,
2300 0x07,
2301 0x03,
2302 0x04,
2303 0x1c,
2304 0x0a,
2305 0x09,
2306 0x03,
2307 0x08,
2308 0x03,
2309 0x07,
2310 0x03,
2311 0x02,
2312 0x03,
2313 0x03,
2314 0x03,
2315 0x0c,
2316 0x04,
2317 0x05,
2318 0x03,
2319 0x0b,
2320 0x06,
2321 0x01,
2322 0x0e,
2323 0x15,
2324 0x05,
2325 0x3a,
2326 0x03,
2327 0x11,
2328 0x07,
2329 0x06,
2330 0x05,
2331 0x10,
2332 0x07,
2333 0x57,
2334 0x07,
2335 0x02,
2336 0x07,
2337 0x15,
2338 0x0d,
2339 0x50,
2340 0x04,
2341 0x43,
2342 0x03,
2343 0x2d,
2344 0x03,
2345 0x01,
2346 0x04,
2347 0x11,
2348 0x06,
2349 0x0f,
2350 0x0c,
2351 0x3a,
2352 0x04,
2353 0x1d,
2354 0x25,
2355 0x5f,
2356 0x20,
2357 0x6d,
2358 0x04,
2359 0x6a,
2360 0x25,
2361 0x80,
2362 0xc8,
2363 0x05,
2364 0x82,
2365 0xb0,
2366 0x03,
2367 0x1a,
2368 0x06,
2369 0x82,
2370 0xfd,
2371 0x03,
2372 0x59,
2373 0x07,
2374 0x15,
2375 0x0b,
2376 0x17,
2377 0x09,
2378 0x14,
2379 0x0c,
2380 0x14,
2381 0x0c,
2382 0x6a,
2383 0x06,
2384 0x0a,
2385 0x06,
2386 0x1a,
2387 0x06,
2388 0x59,
2389 0x07,
2390 0x2b,
2391 0x05,
2392 0x46,
2393 0x0a,
2394 0x2c,
2395 0x04,
2396 0x0c,
2397 0x04,
2398 0x01,
2399 0x03,
2400 0x31,
2401 0x0b,
2402 0x2c,
2403 0x04,
2404 0x1a,
2405 0x06,
2406 0x0b,
2407 0x03,
2408 0x80,
2409 0xac,
2410 0x06,
2411 0x0a,
2412 0x06,
2413 0x21,
2414 0x3f,
2415 0x4c,
2416 0x04,
2417 0x2d,
2418 0x03,
2419 0x74,
2420 0x08,
2421 0x3c,
2422 0x03,
2423 0x0f,
2424 0x03,
2425 0x3c,
2426 0x07,
2427 0x38,
2428 0x08,
2429 0x2b,
2430 0x05,
2431 0x82,
2432 0xff,
2433 0x11,
2434 0x18,
2435 0x08,
2436 0x2f,
2437 0x11,
2438 0x2d,
2439 0x03,
2440 0x20,
2441 0x10,
2442 0x21,
2443 0x0f,
2444 0x80,
2445 0x8c,
2446 0x04,
2447 0x82,
2448 0x97,
2449 0x19,
2450 0x0b,
2451 0x15,
2452 0x88,
2453 0x94,
2454 0x05,
2455 0x2f,
2456 0x05,
2457 0x3b,
2458 0x07,
2459 0x02,
2460 0x0e,
2461 0x18,
2462 0x09,
2463 0x80,
2464 0xb3,
2465 0x2d,
2466 0x74,
2467 0x0c,
2468 0x80,
2469 0xd6,
2470 0x1a,
2471 0x0c,
2472 0x05,
2473 0x80,
2474 0xff,
2475 0x05,
2476 0x80,
2477 0xdf,
2478 0x0c,
2479 0xee,
2480 0x0d,
2481 0x03,
2482 0x84,
2483 0x8d,
2484 0x03,
2485 0x37,
2486 0x09,
2487 0x81,
2488 0x5c,
2489 0x14,
2490 0x80,
2491 0xb8,
2492 0x08,
2493 0x80,
2494 0xcb,
2495 0x2a,
2496 0x38,
2497 0x03,
2498 0x0a,
2499 0x06,
2500 0x38,
2501 0x08,
2502 0x46,
2503 0x08,
2504 0x0c,
2505 0x06,
2506 0x74,
2507 0x0b,
2508 0x1e,
2509 0x03,
2510 0x5a,
2511 0x04,
2512 0x59,
2513 0x09,
2514 0x80,
2515 0x83,
2516 0x18,
2517 0x1c,
2518 0x0a,
2519 0x16,
2520 0x09,
2521 0x4c,
2522 0x04,
2523 0x80,
2524 0x8a,
2525 0x06,
2526 0xab,
2527 0xa4,
2528 0x0c,
2529 0x17,
2530 0x04,
2531 0x31,
2532 0xa1,
2533 0x04,
2534 0x81,
2535 0xda,
2536 0x26,
2537 0x07,
2538 0x0c,
2539 0x05,
2540 0x05,
2541 0x80,
2542 0xa5,
2543 0x11,
2544 0x81,
2545 0x6d,
2546 0x10,
2547 0x78,
2548 0x28,
2549 0x2a,
2550 0x06,
2551 0x4c,
2552 0x04,
2553 0x80,
2554 0x8d,
2555 0x04,
2556 0x80,
2557 0xbe,
2558 0x03,
2559 0x1b,
2560 0x03,
2561 0x0f,
2562 0x0d,
2563 };
2564 static constexpr unsigned char normal1[] = {
2565 0x5e,
2566 0x22,
2567 0x7b,
2568 0x05,
2569 0x03,
2570 0x04,
2571 0x2d,
2572 0x03,
2573 0x66,
2574 0x03,
2575 0x01,
2576 0x2f,
2577 0x2e,
2578 0x80,
2579 0x82,
2580 0x1d,
2581 0x03,
2582 0x31,
2583 0x0f,
2584 0x1c,
2585 0x04,
2586 0x24,
2587 0x09,
2588 0x1e,
2589 0x05,
2590 0x2b,
2591 0x05,
2592 0x44,
2593 0x04,
2594 0x0e,
2595 0x2a,
2596 0x80,
2597 0xaa,
2598 0x06,
2599 0x24,
2600 0x04,
2601 0x24,
2602 0x04,
2603 0x28,
2604 0x08,
2605 0x34,
2606 0x0b,
2607 0x01,
2608 0x80,
2609 0x90,
2610 0x81,
2611 0x37,
2612 0x09,
2613 0x16,
2614 0x0a,
2615 0x08,
2616 0x80,
2617 0x98,
2618 0x39,
2619 0x03,
2620 0x63,
2621 0x08,
2622 0x09,
2623 0x30,
2624 0x16,
2625 0x05,
2626 0x21,
2627 0x03,
2628 0x1b,
2629 0x05,
2630 0x01,
2631 0x40,
2632 0x38,
2633 0x04,
2634 0x4b,
2635 0x05,
2636 0x2f,
2637 0x04,
2638 0x0a,
2639 0x07,
2640 0x09,
2641 0x07,
2642 0x40,
2643 0x20,
2644 0x27,
2645 0x04,
2646 0x0c,
2647 0x09,
2648 0x36,
2649 0x03,
2650 0x3a,
2651 0x05,
2652 0x1a,
2653 0x07,
2654 0x04,
2655 0x0c,
2656 0x07,
2657 0x50,
2658 0x49,
2659 0x37,
2660 0x33,
2661 0x0d,
2662 0x33,
2663 0x07,
2664 0x2e,
2665 0x08,
2666 0x0a,
2667 0x81,
2668 0x26,
2669 0x52,
2670 0x4e,
2671 0x28,
2672 0x08,
2673 0x2a,
2674 0x56,
2675 0x1c,
2676 0x14,
2677 0x17,
2678 0x09,
2679 0x4e,
2680 0x04,
2681 0x1e,
2682 0x0f,
2683 0x43,
2684 0x0e,
2685 0x19,
2686 0x07,
2687 0x0a,
2688 0x06,
2689 0x48,
2690 0x08,
2691 0x27,
2692 0x09,
2693 0x75,
2694 0x0b,
2695 0x3f,
2696 0x41,
2697 0x2a,
2698 0x06,
2699 0x3b,
2700 0x05,
2701 0x0a,
2702 0x06,
2703 0x51,
2704 0x06,
2705 0x01,
2706 0x05,
2707 0x10,
2708 0x03,
2709 0x05,
2710 0x80,
2711 0x8b,
2712 0x62,
2713 0x1e,
2714 0x48,
2715 0x08,
2716 0x0a,
2717 0x80,
2718 0xa6,
2719 0x5e,
2720 0x22,
2721 0x45,
2722 0x0b,
2723 0x0a,
2724 0x06,
2725 0x0d,
2726 0x13,
2727 0x39,
2728 0x07,
2729 0x0a,
2730 0x36,
2731 0x2c,
2732 0x04,
2733 0x10,
2734 0x80,
2735 0xc0,
2736 0x3c,
2737 0x64,
2738 0x53,
2739 0x0c,
2740 0x48,
2741 0x09,
2742 0x0a,
2743 0x46,
2744 0x45,
2745 0x1b,
2746 0x48,
2747 0x08,
2748 0x53,
2749 0x1d,
2750 0x39,
2751 0x81,
2752 0x07,
2753 0x46,
2754 0x0a,
2755 0x1d,
2756 0x03,
2757 0x47,
2758 0x49,
2759 0x37,
2760 0x03,
2761 0x0e,
2762 0x08,
2763 0x0a,
2764 0x06,
2765 0x39,
2766 0x07,
2767 0x0a,
2768 0x81,
2769 0x36,
2770 0x19,
2771 0x80,
2772 0xb7,
2773 0x01,
2774 0x0f,
2775 0x32,
2776 0x0d,
2777 0x83,
2778 0x9b,
2779 0x66,
2780 0x75,
2781 0x0b,
2782 0x80,
2783 0xc4,
2784 0x8a,
2785 0xbc,
2786 0x84,
2787 0x2f,
2788 0x8f,
2789 0xd1,
2790 0x82,
2791 0x47,
2792 0xa1,
2793 0xb9,
2794 0x82,
2795 0x39,
2796 0x07,
2797 0x2a,
2798 0x04,
2799 0x02,
2800 0x60,
2801 0x26,
2802 0x0a,
2803 0x46,
2804 0x0a,
2805 0x28,
2806 0x05,
2807 0x13,
2808 0x82,
2809 0xb0,
2810 0x5b,
2811 0x65,
2812 0x4b,
2813 0x04,
2814 0x39,
2815 0x07,
2816 0x11,
2817 0x40,
2818 0x05,
2819 0x0b,
2820 0x02,
2821 0x0e,
2822 0x97,
2823 0xf8,
2824 0x08,
2825 0x84,
2826 0xd6,
2827 0x2a,
2828 0x09,
2829 0xa2,
2830 0xf7,
2831 0x81,
2832 0x1f,
2833 0x31,
2834 0x03,
2835 0x11,
2836 0x04,
2837 0x08,
2838 0x81,
2839 0x8c,
2840 0x89,
2841 0x04,
2842 0x6b,
2843 0x05,
2844 0x0d,
2845 0x03,
2846 0x09,
2847 0x07,
2848 0x10,
2849 0x93,
2850 0x60,
2851 0x80,
2852 0xf6,
2853 0x0a,
2854 0x73,
2855 0x08,
2856 0x6e,
2857 0x17,
2858 0x46,
2859 0x80,
2860 0x9a,
2861 0x14,
2862 0x0c,
2863 0x57,
2864 0x09,
2865 0x19,
2866 0x80,
2867 0x87,
2868 0x81,
2869 0x47,
2870 0x03,
2871 0x85,
2872 0x42,
2873 0x0f,
2874 0x15,
2875 0x85,
2876 0x50,
2877 0x2b,
2878 0x80,
2879 0xd5,
2880 0x2d,
2881 0x03,
2882 0x1a,
2883 0x04,
2884 0x02,
2885 0x81,
2886 0x70,
2887 0x3a,
2888 0x05,
2889 0x01,
2890 0x85,
2891 0x00,
2892 0x80,
2893 0xd7,
2894 0x29,
2895 0x4c,
2896 0x04,
2897 0x0a,
2898 0x04,
2899 0x02,
2900 0x83,
2901 0x11,
2902 0x44,
2903 0x4c,
2904 0x3d,
2905 0x80,
2906 0xc2,
2907 0x3c,
2908 0x06,
2909 0x01,
2910 0x04,
2911 0x55,
2912 0x05,
2913 0x1b,
2914 0x34,
2915 0x02,
2916 0x81,
2917 0x0e,
2918 0x2c,
2919 0x04,
2920 0x64,
2921 0x0c,
2922 0x56,
2923 0x0a,
2924 0x80,
2925 0xae,
2926 0x38,
2927 0x1d,
2928 0x0d,
2929 0x2c,
2930 0x04,
2931 0x09,
2932 0x07,
2933 0x02,
2934 0x0e,
2935 0x06,
2936 0x80,
2937 0x9a,
2938 0x83,
2939 0xd8,
2940 0x08,
2941 0x0d,
2942 0x03,
2943 0x0d,
2944 0x03,
2945 0x74,
2946 0x0c,
2947 0x59,
2948 0x07,
2949 0x0c,
2950 0x14,
2951 0x0c,
2952 0x04,
2953 0x38,
2954 0x08,
2955 0x0a,
2956 0x06,
2957 0x28,
2958 0x08,
2959 0x22,
2960 0x4e,
2961 0x81,
2962 0x54,
2963 0x0c,
2964 0x15,
2965 0x03,
2966 0x03,
2967 0x05,
2968 0x07,
2969 0x09,
2970 0x19,
2971 0x07,
2972 0x07,
2973 0x09,
2974 0x03,
2975 0x0d,
2976 0x07,
2977 0x29,
2978 0x80,
2979 0xcb,
2980 0x25,
2981 0x0a,
2982 0x84,
2983 0x06,
2984 };
2985 auto lower = static_cast<uint16_t>(cp);
2986 if (cp < 0x10000)
2987 {
2988 return is_printable(lower, singletons0,
2989 sizeof(singletons0) / sizeof(*singletons0),
2990 singletons0_lower, normal0, sizeof(normal0));
2991 }
2992 if (cp < 0x20000)
2993 {
2994 return is_printable(lower, singletons1,
2995 sizeof(singletons1) / sizeof(*singletons1),
2996 singletons1_lower, normal1, sizeof(normal1));
2997 }
2998 if (0x2a6de <= cp && cp < 0x2a700)
2999 return false;
3000 if (0x2b735 <= cp && cp < 0x2b740)
3001 return false;
3002 if (0x2b81e <= cp && cp < 0x2b820)
3003 return false;
3004 if (0x2cea2 <= cp && cp < 0x2ceb0)
3005 return false;
3006 if (0x2ebe1 <= cp && cp < 0x2f800)
3007 return false;
3008 if (0x2fa1e <= cp && cp < 0x30000)
3009 return false;
3010 if (0x3134b <= cp && cp < 0xe0100)
3011 return false;
3012 if (0xe01f0 <= cp && cp < 0x110000)
3013 return false;
3014 return cp < 0x110000;
3015 }
3016
3017} // namespace detail
3018
3020
3021#endif // FMT_FORMAT_INL_H_
Definition core.h:2524
Definition core.h:2338
constexpr auto size() const noexcept -> size_t
Definition core.h:541
constexpr auto data() const noexcept -> const Char *
Definition core.h:535
Definition format.h:3228
Definition core.h:1032
FMT_CONSTEXPR auto data() noexcept -> T *
Definition core.h:1102
constexpr auto size() const noexcept -> size_t
Definition core.h:1090
Definition format.h:352
constexpr uint64_t low() const noexcept
Definition format.h:372
constexpr uint64_t high() const noexcept
Definition format.h:368
Definition format.h:1113
~format_error() noexcept override FMT_MSC_DEFAULT
Definition core.h:2245
const void * locale_
Definition core.h:2247
constexpr locale_ref()
Definition core.h:2250
auto get() const -> Locale
Definition core.h:1598
auto format_to(OutputIt out, const text_style &ts, const S &format_str, Args &&... args) -> typename std::enable_if< enable, OutputIt >::type
Definition color.h:677
#define FMT_ASSERT(condition, message)
Definition core.h:403
basic_string_view< char > string_view
Definition core.h:604
uint128_opt
Definition core.h:443
constexpr auto count() -> size_t
Definition core.h:1538
#define FMT_CONSTEXPR
Definition core.h:106
basic_format_parse_context< char > format_parse_context
Definition core.h:856
#define FMT_BEGIN_NAMESPACE
Definition core.h:214
#define FMT_API
Definition core.h:250
conditional_t< std::is_same< T, char >::value, appender, std::back_insert_iterator< buffer< T > > > buffer_appender
Definition core.h:1398
#define FMT_INLINE
Definition core.h:199
FMT_INLINE auto format_to(OutputIt out, format_string< T... > fmt, T &&... args) -> OutputIt
Definition core.h:4120
typename std::conditional< B, T, F >::type conditional_t
Definition core.h:304
#define FMT_END_NAMESPACE
Definition core.h:219
#define offset(member)
Definition css_properties.cpp:5
#define out
Definition encodings.cpp:5
FMT_FUNC std::system_error vsystem_error(int error_code, string_view format_str, format_args args)
Definition format-inl.h:138
FMT_FUNC void format_system_error(detail::buffer< char > &out, int error_code, const char *message) noexcept
Definition format-inl.h:1558
FMT_FUNC void vprint(std::FILE *f, string_view format_str, format_args args)
Definition format-inl.h:1630
FMT_FUNC std::string vformat(string_view fmt, format_args args)
Definition format-inl.h:1578
FMT_FUNC void report_system_error(int error_code, const char *message) noexcept
Definition format-inl.h:1572
#define FMT_FUNC
Definition format.h:5026
auto system_error(int error_code, format_string< T... > fmt, T &&... args) -> std::system_error
Definition format.h:4326
#define FMT_STRING(s)
Definition format.h:2155
FMT_API auto decimal_point_impl(locale_ref loc) -> Char
FMT_API void format_error_code(buffer< char > &out, int error_code, string_view message) noexcept
@ inline_buffer_size
Definition format.h:929
#define FMT_TRY
Definition format.h:111
void(*)(detail::buffer< char > &, int, const char *) format_func
Definition format.h:4299
FMT_API auto thousands_sep_impl(locale_ref loc) -> thousands_sep_result< Char >
FMT_API void report_error(format_func func, int error_code, const char *message) noexcept
conditional_t< num_bits< T >()<=32 &&!FMT_REDUCE_INT_INSTANTIATIONS, uint32_t, conditional_t< num_bits< T >()<=64, uint64_t, uint128_t > > uint32_or_64_or_128_t
Definition format.h:1212
auto to_string(const T &value) -> std::string
Definition format.h:4827
basic_memory_buffer< char > memory_buffer
Definition format.h:1095
#define FMT_CATCH(x)
Definition format.h:112
auto thousands_sep(locale_ref loc) -> thousands_sep_result< Char >
Definition format.h:1388
#define FMT_THROW(x)
Definition format.h:99
auto ptr(T p) -> const void *
Definition format.h:4568
FMT_CONSTEXPR auto write(OutputIt out, Char value, const basic_format_specs< Char > &specs, locale_ref loc={}) -> OutputIt
Definition format.h:2272
uint32_t divide_by_10_to_kappa_plus_1(uint32_t n) noexcept
Definition format-inl.h:313
bool is_left_endpoint_integer_shorter_interval(int exponent) noexcept
Definition format-inl.h:1202
uint32_t small_division_by_pow10(uint32_t n) noexcept
Definition format-inl.h:303
FMT_INLINE int remove_trailing_zeros(uint32_t &n) noexcept
Definition format-inl.h:1211
uint64_t umul96_upper64(uint32_t x, uint64_t y) noexcept
Definition format-inl.h:223
int shift_amount
Definition format-inl.h:269
uint32_t divisor
Definition format-inl.h:268
int floor_log2_pow10(int e) noexcept
Definition format-inl.h:255
uint64_t umul128_upper64(uint64_t x, uint64_t y) noexcept
Definition format-inl.h:199
uint64_t umul96_lower64(uint32_t x, uint64_t y) noexcept
Definition format-inl.h:240
FMT_INLINE decimal_fp< T > shorter_interval_case(int exponent) noexcept
Definition format-inl.h:1301
int floor_log10_pow2_minus_log10_4_over_3(int e) noexcept
Definition format-inl.h:260
uint128_fallback umul192_upper128(uint64_t x, uint128_fallback y) noexcept
Definition format-inl.h:213
int floor_log10_pow2(int e) noexcept
Definition format-inl.h:247
bool check_divisibility_and_divide_by_pow10(uint32_t &n) noexcept
Definition format-inl.h:276
uint128_fallback umul192_lower128(uint64_t x, uint128_fallback y) noexcept
Definition format-inl.h:230
decimal_fp< T > to_decimal(T x) noexcept
Definition format-inl.h:1354
Definition args.h:20
uint128_fallback umul128(uint64_t x, uint64_t y) noexcept
Definition format-inl.h:166
FMT_FUNC void format_error_code(detail::buffer< char > &out, int error_code, string_view message) noexcept
Definition format-inl.h:50
FMT_FUNC void print(std::FILE *f, string_view text)
Definition format-inl.h:1620
FMT_CONSTEXPR uint32_t rotr(uint32_t n, uint32_t r) noexcept
Definition format-inl.h:154
FMT_FUNC void report_error(format_func func, int error_code, const char *message) noexcept
Definition format-inl.h:74
FMT_FUNC void throw_format_error(const char *message)
Definition format-inl.h:45
FMT_FUNC void assert_fail(const char *file, int line, const char *message)
Definition format-inl.h:35
bool operator==(basic_fp< F > x, basic_fp< F > y)
Definition format-inl.h:148
void fwrite_fully(const void *ptr, size_t size, size_t count, FILE *stream)
Definition format-inl.h:84
auto is_printable(uint16_t x, const singleton *singletons, size_t singletons_size, const unsigned char *singleton_lowers, const unsigned char *normal, size_t normal_size) -> bool
Definition format-inl.h:1662
Definition format.h:1539
Definition bin_to_hex.h:111
Definition format.h:1666
int e
Definition format.h:1668
F f
Definition format.h:1667
static compute_mul_result compute_mul(carrier_uint u, const cache_entry_type &cache) noexcept
Definition format-inl.h:1151
static uint32_t compute_delta(cache_entry_type const &cache, int beta) noexcept
Definition format-inl.h:1158
float_info< double >::carrier_uint carrier_uint
Definition format-inl.h:434
static carrier_uint compute_right_endpoint_for_shorter_interval_case(const cache_entry_type &cache, int beta) noexcept
Definition format-inl.h:1183
static compute_mul_parity_result compute_mul_parity(carrier_uint two_f, const cache_entry_type &cache, int beta) noexcept
Definition format-inl.h:1164
static carrier_uint compute_round_up_for_shorter_interval_case(const cache_entry_type &cache, int beta) noexcept
Definition format-inl.h:1191
static carrier_uint compute_left_endpoint_for_shorter_interval_case(const cache_entry_type &cache, int beta) noexcept
Definition format-inl.h:1175
static uint128_fallback get_cached_power(int k) noexcept
Definition format-inl.h:437
float_info< float >::carrier_uint carrier_uint
Definition format-inl.h:332
uint64_t cache_entry_type
Definition format-inl.h:333
static uint64_t get_cached_power(int k) noexcept
Definition format-inl.h:335
static carrier_uint compute_right_endpoint_for_shorter_interval_case(const cache_entry_type &cache, int beta) noexcept
Definition format-inl.h:413
static carrier_uint compute_left_endpoint_for_shorter_interval_case(const cache_entry_type &cache, int beta) noexcept
Definition format-inl.h:405
static carrier_uint compute_round_up_for_shorter_interval_case(const cache_entry_type &cache, int beta) noexcept
Definition format-inl.h:421
static compute_mul_parity_result compute_mul_parity(carrier_uint two_f, const cache_entry_type &cache, int beta) noexcept
Definition format-inl.h:394
static uint32_t compute_delta(const cache_entry_type &cache, int beta) noexcept
Definition format-inl.h:388
static compute_mul_result compute_mul(carrier_uint u, const cache_entry_type &cache) noexcept
Definition format-inl.h:380
Definition format-inl.h:327
Definition format-inl.h:1657
unsigned char lower_count
Definition format-inl.h:1659
unsigned char upper
Definition format-inl.h:1658
auto format(const detail::bigint &n, FormatContext &ctx) const -> typename FormatContext::iterator
Definition format-inl.h:1515
FMT_CONSTEXPR auto parse(format_parse_context &ctx) -> format_parse_context::iterator
Definition format-inl.h:1508
Definition core.h:944
Definition format.h:1380
q
Definition tag_strings.h:49
b
Definition tag_strings.h:61
s
Definition tag_strings.h:47
a
Definition tag_strings.h:43
u
Definition tag_strings.h:62
i
Definition tag_strings.h:60
br
Definition tag_strings.h:70
p
Definition tag_strings.h:29