mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 03:56:16 +00:00
LibCrypto: Add operator<= and operator>= to SignedBigInteger
This commit is contained in:
parent
121e7626d0
commit
ff6ca0f02d
Notes:
sideshowbarker
2024-07-18 08:46:04 +09:00
Author: https://github.com/IdanHo
Commit: ff6ca0f02d
Pull-request: https://github.com/SerenityOS/serenity/pull/8870
Reviewed-by: https://github.com/linusg
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;
|
||||
}
|
||||
|
||||
bool SignedBigInteger::operator<=(const SignedBigInteger& other) const
|
||||
{
|
||||
return *this < other || *this == other;
|
||||
}
|
||||
|
||||
bool SignedBigInteger::operator>(const SignedBigInteger& other) const
|
||||
{
|
||||
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 UnsignedBigInteger& other) const;
|
||||
bool operator!=(const UnsignedBigInteger& other) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue