diff --git a/include/mtl/fixed.hpp b/include/mtl/fixed.hpp index 432995c..96d7d83 100644 --- a/include/mtl/fixed.hpp +++ b/include/mtl/fixed.hpp @@ -167,6 +167,28 @@ public: *this = *this / rhs; return *this; } + + /** + * \brief Comparison operators + */ + constexpr fixed operator==(fixed rhs) const noexcept { + return x == rhs.x; + } + constexpr fixed operator!=(fixed rhs) const noexcept { + return x != rhs.x; + } + constexpr fixed operator>(fixed rhs) const noexcept { + return x > rhs.x; + } + constexpr fixed operator>=(fixed rhs) const noexcept { + return x >= rhs.x; + } + constexpr fixed operator<(fixed rhs) const noexcept { + return x < rhs.x; + } + constexpr fixed operator<=(fixed rhs) const noexcept { + return x <= rhs.x; + } }; } // namespace mtl