AK: Fix UFixedBigInt comparison operators
Instead of using the specified type U like we want, we were using the type T all along when comparing with smaller integers. This is now fixed.
This commit is contained in:
parent
143465b23a
commit
6124050187
Notes:
sideshowbarker
2024-07-17 21:44:23 +09:00
Author: https://github.com/b0iizz 🔰 Commit: https://github.com/SerenityOS/serenity/commit/6124050187b Pull-request: https://github.com/SerenityOS/serenity/pull/11546
1 changed files with 6 additions and 6 deletions
|
@ -135,32 +135,32 @@ public:
|
|||
return m_low || m_high;
|
||||
}
|
||||
template<Unsigned U>
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator==(const T& other) const
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator==(const U& other) const
|
||||
{
|
||||
return !m_high && m_low == other;
|
||||
}
|
||||
template<Unsigned U>
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator!=(const T& other) const
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator!=(const U& other) const
|
||||
{
|
||||
return m_high || m_low != other;
|
||||
}
|
||||
template<Unsigned U>
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator>(const T& other) const
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator>(const U& other) const
|
||||
{
|
||||
return m_high || m_low > other;
|
||||
}
|
||||
template<Unsigned U>
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator<(const T& other) const
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator<(const U& other) const
|
||||
{
|
||||
return !m_high && m_low < other;
|
||||
}
|
||||
template<Unsigned U>
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator>=(const T& other) const
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator>=(const U& other) const
|
||||
{
|
||||
return *this == other || *this > other;
|
||||
}
|
||||
template<Unsigned U>
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator<=(const T& other) const
|
||||
requires(sizeof(T) >= sizeof(U)) constexpr bool operator<=(const U& other) const
|
||||
{
|
||||
return *this == other || *this < other;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue