mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:07:35 +00:00
LibCrypto: Add operator<= and operator>= to SignedBigInteger
This commit is contained in:
parent
121e7626d0
commit
ff6ca0f02d
2 changed files with 12 additions and 0 deletions
|
@ -280,9 +280,19 @@ bool SignedBigInteger::operator<(const SignedBigInteger& other) const
|
||||||
return m_unsigned_data < other.m_unsigned_data;
|
return m_unsigned_data < other.m_unsigned_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SignedBigInteger::operator<=(const SignedBigInteger& other) const
|
||||||
|
{
|
||||||
|
return *this < other || *this == other;
|
||||||
|
}
|
||||||
|
|
||||||
bool SignedBigInteger::operator>(const SignedBigInteger& other) const
|
bool SignedBigInteger::operator>(const SignedBigInteger& other) const
|
||||||
{
|
{
|
||||||
return *this != other && !(*this < other);
|
return *this != other && !(*this < other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SignedBigInteger::operator>=(const SignedBigInteger& other) const
|
||||||
|
{
|
||||||
|
return !(*this < other);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,9 @@ public:
|
||||||
bool operator==(const SignedBigInteger& other) const;
|
bool operator==(const SignedBigInteger& other) const;
|
||||||
bool operator!=(const SignedBigInteger& other) const;
|
bool operator!=(const SignedBigInteger& other) const;
|
||||||
bool operator<(const SignedBigInteger& other) const;
|
bool operator<(const SignedBigInteger& other) const;
|
||||||
|
bool operator<=(const SignedBigInteger& other) const;
|
||||||
bool operator>(const SignedBigInteger& other) const;
|
bool operator>(const SignedBigInteger& other) const;
|
||||||
|
bool operator>=(const SignedBigInteger& other) const;
|
||||||
|
|
||||||
bool operator==(const UnsignedBigInteger& other) const;
|
bool operator==(const UnsignedBigInteger& other) const;
|
||||||
bool operator!=(const UnsignedBigInteger& other) const;
|
bool operator!=(const UnsignedBigInteger& other) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue