@@ -1227,6 +1227,9 @@ template <typename Integer>
12271227constexpr auto operator /(decimal64_fast lhs, Integer rhs) noexcept
12281228 BOOST_DECIMAL_REQUIRES_RETURN (detail::is_integral_v, Integer, decimal64_fast)
12291229{
1230+ using promoted_significand_type = detail::promote_significand_t <decimal64_fast, Integer>;
1231+ using exp_type = detail::decimal64_fast_components::biased_exponent_type;
1232+
12301233 #ifndef BOOST_DECIMAL_FAST_MATH
12311234 // Check pre-conditions
12321235 constexpr decimal64_fast zero {0 , 0 };
@@ -1261,8 +1264,8 @@ constexpr auto operator/(decimal64_fast lhs, Integer rhs) noexcept
12611264
12621265 detail::decimal64_fast_components lhs_components {lhs_sig, lhs_exp, lhs.isneg ()};
12631266
1264- auto rhs_sig {static_cast <decimal64_fast::significand_type >(detail::make_positive_unsigned (rhs))};
1265- std:: int32_t rhs_exp {};
1267+ auto rhs_sig {static_cast <promoted_significand_type >(detail::make_positive_unsigned (rhs))};
1268+ exp_type rhs_exp {};
12661269 detail::decimal64_fast_components rhs_components {detail::shrink_significand<decimal64_fast::significand_type>(rhs_sig, rhs_exp), rhs_exp, rhs < 0 };
12671270
12681271 return detail::d64_generic_div_impl<decimal64_fast>(lhs_components, rhs_components);
@@ -1272,6 +1275,9 @@ template <typename Integer>
12721275constexpr auto operator /(Integer lhs, decimal64_fast rhs) noexcept
12731276 BOOST_DECIMAL_REQUIRES_RETURN (detail::is_integral_v, Integer, decimal64_fast)
12741277{
1278+ using promoted_significand_type = detail::promote_significand_t <decimal64_fast, Integer>;
1279+ using exp_type = detail::decimal64_fast_components::biased_exponent_type;
1280+
12751281 #ifndef BOOST_DECIMAL_FAST_MATH
12761282 // Check pre-conditions
12771283 constexpr decimal64_fast zero {0 , 0 };
@@ -1301,10 +1307,12 @@ constexpr auto operator/(Integer lhs, decimal64_fast rhs) noexcept
13011307 auto rhs_sig {rhs.full_significand ()};
13021308 auto rhs_exp {rhs.biased_exponent ()};
13031309 detail::normalize<decimal64>(rhs_sig, rhs_exp);
1304-
1305- detail::decimal64_fast_components lhs_components {detail::make_positive_unsigned (lhs), 0 , lhs < 0 };
13061310 detail::decimal64_fast_components rhs_components {rhs_sig, rhs_exp, rhs.isneg ()};
13071311
1312+ auto lhs_sig {static_cast <promoted_significand_type>(detail::make_positive_unsigned (lhs))};
1313+ exp_type lhs_exp {};
1314+ detail::decimal64_fast_components lhs_components {detail::shrink_significand<decimal64_fast::significand_type>(lhs_sig, lhs_exp), lhs_exp, lhs < 0 };
1315+
13081316 return detail::d64_generic_div_impl<decimal64_fast>(lhs_components, rhs_components);
13091317}
13101318
0 commit comments