mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +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
|
@ -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…
Reference in a new issue