Add fixed point comparison operators
This commit is contained in:
parent
10c32a4a71
commit
e87f10301f
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user