mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibCrypto: Fix -0 and 0 non-equality
SignedBigInteger::operator==(const UnsignedBigInteger&) was rejecting all negative value before testing for equality. It now accepts negative zero and test for a value equality with the UnsignedBigInteger.
This commit is contained in:
parent
6a937312b3
commit
4ab8ad2ed2
1 changed files with 1 additions and 1 deletions
|
@ -246,7 +246,7 @@ FLATTEN SignedBigInteger SignedBigInteger::bitwise_xor(SignedBigInteger const& o
|
|||
|
||||
bool SignedBigInteger::operator==(UnsignedBigInteger const& other) const
|
||||
{
|
||||
if (m_sign)
|
||||
if (m_sign && m_unsigned_data != 0)
|
||||
return false;
|
||||
return m_unsigned_data == other;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue