Skip to content

Commit 30c0fba

Browse files
committed
Fix narrowing
1 parent bfa8a18 commit 30c0fba

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

include/boost/decimal/detail/mul_impl.hpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,10 @@ namespace detail {
2525
// 1) Returns a decimal type and lets the constructor handle with shrinking the significand
2626
// 2) Returns a struct of the constituent components (used with FMAs)
2727

28-
template <typename ReturnType, typename T, typename U>
29-
BOOST_DECIMAL_FORCE_INLINE constexpr auto mul_impl(T lhs_sig, U lhs_exp, bool lhs_sign,
30-
T rhs_sig, U rhs_exp, bool rhs_sign) noexcept -> std::enable_if_t<std::is_same<ReturnType, decimal32_fast>::value || std::is_same<ReturnType, decimal32_fast_components>::value, ReturnType>
31-
{
32-
using mul_type = std::uint_fast64_t;
33-
34-
const auto res_sig {static_cast<mul_type>(lhs_sig) * static_cast<mul_type>(rhs_sig)};
35-
const auto res_exp {lhs_exp + rhs_exp};
36-
37-
return {res_sig, res_exp, lhs_sign != rhs_sign};
38-
}
3928

4029
template <typename ReturnType, typename T, typename U>
4130
BOOST_DECIMAL_FORCE_INLINE constexpr auto mul_impl(T lhs_sig, U lhs_exp, bool lhs_sign,
42-
T rhs_sig, U rhs_exp, bool rhs_sign) noexcept -> std::enable_if_t<std::is_same<ReturnType, decimal32>::value || std::is_same<ReturnType, decimal32_components>::value, ReturnType>
31+
T rhs_sig, U rhs_exp, bool rhs_sign) noexcept -> ReturnType
4332
{
4433
using mul_type = std::uint_fast64_t;
4534

0 commit comments

Comments
 (0)