From 9b62310f03fb4f9e87d73e486d0148f6baf72549 Mon Sep 17 00:00:00 2001 From: Junekey Jeon Date: Tue, 8 Feb 2022 23:26:20 -0800 Subject: [PATCH] Fix some conversion issues --- include/fmt/format-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 21b2afaf..aa130f1e 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -328,7 +328,7 @@ FMT_CONSTEXPR inline fp get_cached_power(int min_exponent, int& pow10_exponent) { const int shift = 32; // log10(2) = 0x0.4d104d427de7fbcc... - const auto significand = static_cast(0x4d104d427de7fbcc); + const int64_t significand = 0x4d104d427de7fbcc; int index = static_cast( ((min_exponent + fp::num_significand_bits - 1) * (significand >> shift) + ((int64_t(1) << shift) - 1)) // ceil @@ -963,7 +963,7 @@ template uint32_t small_division_by_pow10(uint32_t n) noexcept { // Computes floor(n / 10^(kappa + 1)) (float) inline uint32_t divide_by_10_to_kappa_plus_1(uint32_t n) noexcept { // 1374389535 = ceil(2^37/100) - return (static_cast(n) * 1374389535) >> 37; + return static_cast((static_cast(n) * 1374389535) >> 37); } // Computes floor(n / 10^(kappa + 1)) (double) inline uint64_t divide_by_10_to_kappa_plus_1(uint64_t n) noexcept {