@@ -228,6 +228,9 @@ BOOST_DECIMAL_EXPORT class decimal_fast64_t final
228228 template <typename Decimal>
229229 friend constexpr Decimal detail::check_non_finite (Decimal lhs, Decimal rhs) noexcept ;
230230
231+ template <typename Decimal>
232+ friend constexpr Decimal detail::check_non_finite (Decimal x) noexcept ;
233+
231234public:
232235 constexpr decimal_fast64_t () noexcept = default;
233236
@@ -1132,7 +1135,7 @@ constexpr auto operator+(const decimal_fast64_t lhs, const Integer rhs) noexcept
11321135 #ifndef BOOST_DECIMAL_FAST_MATH
11331136 if (not_finite (lhs))
11341137 {
1135- return lhs;
1138+ return detail::check_non_finite ( lhs) ;
11361139 }
11371140 #endif
11381141
@@ -1184,7 +1187,7 @@ constexpr auto operator-(const decimal_fast64_t lhs, const Integer rhs) noexcept
11841187 #ifndef BOOST_DECIMAL_FAST_MATH
11851188 if (not_finite (lhs))
11861189 {
1187- return lhs;
1190+ return detail::check_non_finite ( lhs) ;
11881191 }
11891192 #endif
11901193
@@ -1210,7 +1213,7 @@ constexpr auto operator-(const Integer lhs, const decimal_fast64_t rhs) noexcept
12101213 #ifndef BOOST_DECIMAL_FAST_MATH
12111214 if (not_finite (rhs))
12121215 {
1213- return rhs;
1216+ return detail::check_non_finite ( rhs) ;
12141217 }
12151218 #endif
12161219
@@ -1253,7 +1256,7 @@ constexpr auto operator*(const decimal_fast64_t lhs, const Integer rhs) noexcept
12531256 #ifndef BOOST_DECIMAL_FAST_MATH
12541257 if (not_finite (lhs))
12551258 {
1256- return lhs;
1259+ return detail::check_non_finite ( lhs) ;
12571260 }
12581261 #endif
12591262
@@ -1406,17 +1409,16 @@ constexpr auto operator/(const decimal_fast64_t lhs, const Integer rhs) noexcept
14061409 #ifndef BOOST_DECIMAL_FAST_MATH
14071410 // Check pre-conditions
14081411 constexpr decimal_fast64_t zero {0 , 0 };
1409- constexpr decimal_fast64_t nan {boost::decimal::direct_init_d64 (boost::decimal::detail::d64_fast_snan, 0 , false )};
1410- constexpr decimal_fast64_t inf {boost::decimal::direct_init_d64 (boost::decimal::detail::d64_fast_inf, 0 , false )};
1412+ constexpr decimal_fast64_t inf {direct_init_d64 (detail::d64_fast_inf, 0 , false )};
14111413
14121414 const auto lhs_fp {fpclassify (lhs)};
14131415
14141416 switch (lhs_fp)
14151417 {
14161418 case FP_NAN:
1417- return nan ;
1419+ return issignaling (lhs) ? nan_conversion (lhs) : lhs; ;
14181420 case FP_INFINITE:
1419- return inf ;
1421+ return lhs ;
14201422 case FP_ZERO:
14211423 return sign ? -zero : zero;
14221424 default :
@@ -1450,15 +1452,14 @@ constexpr auto operator/(const Integer lhs, const decimal_fast64_t rhs) noexcept
14501452 #ifndef BOOST_DECIMAL_FAST_MATH
14511453 // Check pre-conditions
14521454 constexpr decimal_fast64_t zero {0 , 0 };
1453- constexpr decimal_fast64_t nan {boost::decimal::direct_init_d64 (boost::decimal::detail::d64_fast_snan, 0 , false )};
1454- constexpr decimal_fast64_t inf {boost::decimal::direct_init_d64 (boost::decimal::detail::d64_fast_inf, 0 , false )};
1455+ constexpr decimal_fast64_t inf {direct_init_d64 (detail::d64_fast_inf, 0 , false )};
14551456
14561457 const auto rhs_fp {fpclassify (rhs)};
14571458
14581459 switch (rhs_fp)
14591460 {
14601461 case FP_NAN:
1461- return nan ;
1462+ return issignaling (rhs) ? nan_conversion (rhs) : rhs ;
14621463 case FP_INFINITE:
14631464 return sign ? -zero : zero;
14641465 case FP_ZERO:
0 commit comments