Add fixed point comparison operators
This commit is contained in:
parent
0711ec1fc1
commit
543218e489
@ -167,6 +167,28 @@ public:
|
|||||||
*this = *this / rhs;
|
*this = *this / rhs;
|
||||||
return *this;
|
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
|
} // namespace mtl
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user