mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:07:34 +00:00
LibCrypto: Add a way to compare UnsignedBigInteger with double
This patch also make SignedBigInteger::compare_to_double make use of the new function.
This commit is contained in:
parent
e03f014e7a
commit
54b8a2b094
7 changed files with 259 additions and 158 deletions
|
@ -121,6 +121,14 @@ public:
|
|||
[[nodiscard]] bool operator>(UnsignedBigInteger const& other) const;
|
||||
[[nodiscard]] bool operator>=(UnsignedBigInteger const& other) const;
|
||||
|
||||
enum class CompareResult {
|
||||
DoubleEqualsBigInt,
|
||||
DoubleLessThanBigInt,
|
||||
DoubleGreaterThanBigInt
|
||||
};
|
||||
|
||||
[[nodiscard]] CompareResult compare_to_double(double) const;
|
||||
|
||||
private:
|
||||
friend class UnsignedBigIntegerAlgorithms;
|
||||
// Little endian
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue