Skip to content

Commit fd095ea

Browse files
committed
add a test for abs with complex
1 parent 55aeeed commit fd095ea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

integration_tests/test_complex.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,21 @@ def test_complex():
4040
print(x.real)
4141
print(x.imag)
4242

43+
44+
def test_complex_abs():
45+
x: c32
46+
x = complex(3, 4)
47+
eps: f64
48+
eps = 1e-12
49+
assert abs(abs(x) - 5.0) < eps
50+
y: c64
51+
y = complex(6, 8)
52+
assert abs(abs(y) - 10.0) < eps
53+
54+
4355
def check():
4456
test_real_imag()
4557
test_complex()
58+
test_complex_abs()
4659

4760
check()

0 commit comments

Comments
 (0)