Skip to content

Commit 8dd96d2

Browse files
committed
add a test for abs with complex
1 parent 9bef949 commit 8dd96d2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

integration_tests/test_complex.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,16 @@ def test_real_imag():
1313
# TODO: below test should work
1414
# assert abs(b - 3) < eps
1515

16+
def test_complex_abs():
17+
x: c32
18+
x = complex(3, 4)
19+
eps: f64
20+
eps = 1e-12
21+
assert abs(abs(x) - 5.0) < eps
22+
y: c64
23+
y = complex(6, 8)
24+
assert abs(abs(y) - 10.0) < eps
25+
26+
1627
test_real_imag()
28+
test_complex_abs()

0 commit comments

Comments
 (0)