Commit 7dbe3dcd authored by Junekey Jeon's avatar Junekey Jeon Committed by Victor Zverovich

Recover log10_2_significand

parent 10642e60
...@@ -327,7 +327,8 @@ FMT_CONSTEXPR inline fp operator*(fp x, fp y) { ...@@ -327,7 +327,8 @@ FMT_CONSTEXPR inline fp operator*(fp x, fp y) {
FMT_CONSTEXPR inline fp get_cached_power(int min_exponent, FMT_CONSTEXPR inline fp get_cached_power(int min_exponent,
int& pow10_exponent) { int& pow10_exponent) {
const int shift = 32; const int shift = 32;
const auto significand = static_cast<int64_t>(log10_2_significand); // log10(2) = 0x0.4d104d427de7fbcc...
const auto significand = static_cast<int64_t>(0x4d104d427de7fbcc);
int index = static_cast<int>( int index = static_cast<int>(
((min_exponent + fp::num_significand_bits - 1) * (significand >> shift) + ((min_exponent + fp::num_significand_bits - 1) * (significand >> shift) +
((int64_t(1) << shift) - 1)) // ceil ((int64_t(1) << shift) - 1)) // ceil
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment