From ad2fea0436f2aff2f28d142952631e7bccf91933 Mon Sep 17 00:00:00 2001 From: faze-geek Date: Sat, 2 Mar 2024 11:16:19 +0530 Subject: [PATCH] Use is_close --- tests/10_cmath.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/10_cmath.py b/tests/10_cmath.py index a850f0e3..515c0b50 100644 --- a/tests/10_cmath.py +++ b/tests/10_cmath.py @@ -4,12 +4,12 @@ import math c1 = complex(3, 4) c2 = complex(2, 4.5) -assert c1 + 5 == complex(8,4) -assert c1 + c2 == complex(5, 8.5) -assert c1 - c2 == complex(1, -0.5) -assert c1*4 == complex(12, 16) -assert c1*c2 == complex(-12, 21.5) -assert c2/c1 == complex(0.96, 0.22) +assert isclose(c1 + 5, complex(8, 4)) +assert isclose(c1 + c2, complex(5, 8.5)) +assert isclose(c1 - c2, complex(1, -0.5)) +assert isclose(c1*4, complex(12, 16)) +assert isclose(c1*c2, complex(-12, 21.5)) +assert isclose(c2/c1, complex(0.96, 0.22)) assert isclose(c2**2, complex(-16.25, 17.99999999999999)) assert 1+2j == complex(1, 2) == 2j+1