Adding two negative numbers.

This commit is contained in:
Simon Forman 2022-10-04 12:10:32 -07:00
parent 0333c3c522
commit 70b8bbdc0e
1 changed files with 9 additions and 0 deletions

View File

@ -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__':