mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-25 19:50:05 +00:00
Recover log10_2_significand
This commit is contained in:
parent
10642e6082
commit
7dbe3dcded
@ -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<int64_t>(log10_2_significand);
|
||||
// log10(2) = 0x0.4d104d427de7fbcc...
|
||||
const auto significand = static_cast<int64_t>(0x4d104d427de7fbcc);
|
||||
int index = static_cast<int>(
|
||||
((min_exponent + fp::num_significand_bits - 1) * (significand >> shift) +
|
||||
((int64_t(1) << shift) - 1)) // ceil
|
||||
|
Loading…
Reference in New Issue
Block a user