diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-07-11 23:48:40 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-07-12 19:05:17 +0100 |
commit | 75d1ffea005a1677faa89d6e50e7b9de7817a4f8 (patch) | |
tree | a099c08b2e77cb158e50829c2ba2b96ee5b7ddd2 | |
parent | 01c731aa59c1ea983fecb93518e440e904204036 (diff) | |
download | serenity-75d1ffea005a1677faa89d6e50e7b9de7817a4f8.zip |
LibCrypto: Add the >= operator to UnsignedBigInteger
-rw-r--r-- | Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp index 135bcf5270..1f036af432 100644 --- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp +++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp @@ -337,6 +337,11 @@ bool UnsignedBigInteger::operator>(const UnsignedBigInteger& other) const return *this != other && !(*this < other); } +bool UnsignedBigInteger::operator>=(UnsignedBigInteger const& other) const +{ + return *this > other || *this == other; +} + } void AK::Formatter<Crypto::UnsignedBigInteger>::format(FormatBuilder& fmtbuilder, const Crypto::UnsignedBigInteger& value) diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index e37c9e95b4..9b9e191247 100644 --- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -99,6 +99,7 @@ public: bool operator!=(const UnsignedBigInteger& other) const; bool operator<(const UnsignedBigInteger& other) const; bool operator>(const UnsignedBigInteger& other) const; + bool operator>=(UnsignedBigInteger const& other) const; private: friend class UnsignedBigIntegerAlgorithms; |