From 70b8bbdc0e4f229ca54bb7a6ea9909bf63f60979 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Tue, 4 Oct 2022 12:10:32 -0700 Subject: [PATCH] Adding two negative numbers. --- bigjoyints/big.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bigjoyints/big.py b/bigjoyints/big.py index 5f9ab29..e0aedc0 100644 --- a/bigjoyints/big.py +++ b/bigjoyints/big.py @@ -202,6 +202,15 @@ class BigIntTest(unittest.TestCase): t = z.to_int() self.assertEqual(t, n + m) + def test_Addition_of_two_negatives(self): + n = -12345678901234567898090123445678990 + m = -901234567898090 + x = BigInt(n) + y = BigInt(m) + z = x + y + t = z.to_int() + self.assertEqual(t, n + m) + if __name__ == '__main__': -- 2.11.0