mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 01:06:48 +08:00
Fix power_of_five_128 to be usable in constexpr in MSVC, clang
This commit is contained in:
parent
0e4b873d81
commit
e320512755
@ -36,11 +36,7 @@ constexpr static int smallest_power_of_five = binary_format<double>::smallest_po
|
|||||||
constexpr static int largest_power_of_five = binary_format<double>::largest_power_of_ten();
|
constexpr static int largest_power_of_five = binary_format<double>::largest_power_of_ten();
|
||||||
constexpr static int number_of_entries = 2 * (largest_power_of_five - smallest_power_of_five + 1);
|
constexpr static int number_of_entries = 2 * (largest_power_of_five - smallest_power_of_five + 1);
|
||||||
// Powers of five from 5^-342 all the way to 5^308 rounded toward one.
|
// Powers of five from 5^-342 all the way to 5^308 rounded toward one.
|
||||||
static const uint64_t power_of_five_128[number_of_entries];
|
constexpr static uint64_t power_of_five_128[number_of_entries] = {
|
||||||
};
|
|
||||||
|
|
||||||
template <class unused>
|
|
||||||
constexpr uint64_t powers_template<unused>::power_of_five_128[number_of_entries] = {
|
|
||||||
0xeef453d6923bd65a,0x113faa2906a13b3f,
|
0xeef453d6923bd65a,0x113faa2906a13b3f,
|
||||||
0x9558b4661b6565f8,0x4ac7ca59a424c507,
|
0x9558b4661b6565f8,0x4ac7ca59a424c507,
|
||||||
0xbaaee17fa23ebf76,0x5d79bcf00d2df649,
|
0xbaaee17fa23ebf76,0x5d79bcf00d2df649,
|
||||||
@ -692,6 +688,11 @@ constexpr uint64_t powers_template<unused>::power_of_five_128[number_of_entries]
|
|||||||
0xb6472e511c81471d,0xe0133fe4adf8e952,
|
0xb6472e511c81471d,0xe0133fe4adf8e952,
|
||||||
0xe3d8f9e563a198e5,0x58180fddd97723a6,
|
0xe3d8f9e563a198e5,0x58180fddd97723a6,
|
||||||
0x8e679c2f5e44ff8f,0x570f09eaa7ea7648,};
|
0x8e679c2f5e44ff8f,0x570f09eaa7ea7648,};
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class unused>
|
||||||
|
constexpr uint64_t powers_template<unused>::power_of_five_128[number_of_entries];
|
||||||
|
|
||||||
using powers = powers_template<>;
|
using powers = powers_template<>;
|
||||||
|
|
||||||
} // namespace fast_float
|
} // namespace fast_float
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user