Skip to content

Commit 6caf078

Browse files
committed
Directly implement operator!=
1 parent c4c0f6c commit 6caf078

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

include/boost/decimal/decimal32_fast.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,13 @@ constexpr auto operator==(decimal32_fast lhs, decimal32_fast rhs) noexcept -> bo
485485

486486
constexpr auto operator!=(decimal32_fast lhs, decimal32_fast rhs) noexcept -> bool
487487
{
488-
return !(lhs == rhs);
488+
return
489+
#ifndef BOOST_DECIMAL_FAST_MATH
490+
isnan(lhs) || isnan(rhs) ||
491+
#endif
492+
(lhs.sign_ != rhs.sign_) ||
493+
(lhs.exponent_ != rhs.exponent_) ||
494+
(lhs.significand_ != rhs.significand_);
489495
}
490496

491497
constexpr auto operator<(decimal32_fast lhs, decimal32_fast rhs) noexcept -> bool

0 commit comments

Comments
 (0)