constexpr -> const for portability

This commit is contained in:
Victor Zverovich 2022-03-23 21:14:22 -07:00
parent 7ffe87c0bc
commit 17dda58391

View File

@ -223,10 +223,10 @@ template <typename F> struct basic_fp {
"unsupported FP"); "unsupported FP");
// Assume Float is in the format [sign][exponent][significand]. // Assume Float is in the format [sign][exponent][significand].
using carrier_uint = typename dragonbox::float_info<Float>::carrier_uint; using carrier_uint = typename dragonbox::float_info<Float>::carrier_uint;
constexpr auto num_float_significand_bits = const auto num_float_significand_bits =
detail::num_significand_bits<Float>(); detail::num_significand_bits<Float>();
constexpr auto implicit_bit = carrier_uint(1) << num_float_significand_bits; const auto implicit_bit = carrier_uint(1) << num_float_significand_bits;
constexpr auto significand_mask = implicit_bit - 1; const auto significand_mask = implicit_bit - 1;
auto u = bit_cast<carrier_uint>(n); auto u = bit_cast<carrier_uint>(n);
f = static_cast<F>(u & significand_mask); f = static_cast<F>(u & significand_mask);
auto biased_e = static_cast<int>((u & exponent_mask<Float>()) >> auto biased_e = static_cast<int>((u & exponent_mask<Float>()) >>