mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
LibCrypto: Add a way to compare a SignedBigInteger with a double
This supports any double value (except for NaNs) instead of having to cast the double to some smaller type which doesn't work for very large values.
This commit is contained in:
parent
14264ca022
commit
b5c00830c2
3 changed files with 271 additions and 1 deletions
|
@ -139,6 +139,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:
|
||||
void ensure_sign_is_valid()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue