Fix init of power_of_10 array

This commit is contained in:
Matt Borland
2023-01-18 11:47:07 -08:00
parent dea69677eb
commit e8db8b0bf4

View File

@@ -157,9 +157,10 @@ BOOST_CXX14_CONSTEXPR int num_digits(std::uint64_t x) noexcept
#ifdef __GLIBCXX_TYPE_INT_N_0
static constexpr std::array<std::uint64_t, 20> powers_of_10 =
{{
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000,
100000000000, 1000000000000, 10000000000000, 100000000000000, 1000000000000000, 10000000000000000,
100000000000000000, 1000000000000000000, 10000000000000000000
UINT64_C(1), UINT64_C(10), UINT64_C(100), UINT64_C(1000), UINT64_C(10000), UINT64_C(100000), UINT64_C(1000000),
UINT64_C(10000000), UINT64_C(100000000), UINT64_C(1000000000), UINT64_C(10000000000), UINT64_C(100000000000),
UINT64_C(1000000000000), UINT64_C(10000000000000), UINT64_C(100000000000000), UINT64_C(1000000000000000),
UINT64_C(10000000000000000), UINT64_C(100000000000000000), UINT64_C(1000000000000000000), UINT64_C(10000000000000000000)
}};
// Assume that if someone is using 128 bit ints they are favoring the top end of the range