Skip to content

Commit

Permalink
add a test for abs with complex
Browse files Browse the repository at this point in the history
  • Loading branch information
Smit-create committed Mar 25, 2022
1 parent 55aeeed commit fd095ea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions integration_tests/test_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,21 @@ def test_complex():
print(x.real)
print(x.imag)


def test_complex_abs():
x: c32
x = complex(3, 4)
eps: f64
eps = 1e-12
assert abs(abs(x) - 5.0) < eps
y: c64
y = complex(6, 8)
assert abs(abs(y) - 10.0) < eps


def check():
test_real_imag()
test_complex()
test_complex_abs()

check()

0 comments on commit fd095ea

Please sign in to comment.