Skip to content

Commit 7dbe3dc

Browse files
jk-jeonvitaut
authored andcommitted
Recover log10_2_significand
1 parent 10642e6 commit 7dbe3dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/fmt/format-inl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ FMT_CONSTEXPR inline fp operator*(fp x, fp y) {
327327
FMT_CONSTEXPR inline fp get_cached_power(int min_exponent,
328328
int& pow10_exponent) {
329329
const int shift = 32;
330-
const auto significand = static_cast<int64_t>(log10_2_significand);
330+
// log10(2) = 0x0.4d104d427de7fbcc...
331+
const auto significand = static_cast<int64_t>(0x4d104d427de7fbcc);
331332
int index = static_cast<int>(
332333
((min_exponent + fp::num_significand_bits - 1) * (significand >> shift) +
333334
((int64_t(1) << shift) - 1)) // ceil

0 commit comments

Comments
 (0)