From 7dbe3dcdeda30ce11d9ca1c5743bd1a75464fa0c Mon Sep 17 00:00:00 2001 From: Junekey Jeon Date: Tue, 8 Feb 2022 18:36:28 -0800 Subject: [PATCH] Recover log10_2_significand --- include/fmt/format-inl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 733a3d9d..f35830d7 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -327,7 +327,8 @@ FMT_CONSTEXPR inline fp operator*(fp x, fp y) { FMT_CONSTEXPR inline fp get_cached_power(int min_exponent, int& pow10_exponent) { const int shift = 32; - const auto significand = static_cast(log10_2_significand); + // log10(2) = 0x0.4d104d427de7fbcc... + const auto significand = static_cast(0x4d104d427de7fbcc); int index = static_cast( ((min_exponent + fp::num_significand_bits - 1) * (significand >> shift) + ((int64_t(1) << shift) - 1)) // ceil