Skip to content

Commit

Permalink
Enable complex power operation test
Browse files Browse the repository at this point in the history
  • Loading branch information
plajjan committed Jan 11, 2025
1 parent 25c9f9a commit 9b88522
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/builtins_auto/test_complex.act
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ def test_complex() -> bool:
# Test power operation
# (1 + i)² = 1 + 2i - 1 = 2i
c = complex.from_real_imag(1.0, 1.0)
# TODO: this depends on __fromatom__ being implemented
#d = c ** 2
#if abs(d.real()) > 1e-10 or abs(d.imag() - 2.0) > 1e-10:
# print("Power operation failed - expected 0.0+2.0i, got:", d.real(), "+", d.imag(), "i")
# return False
d = c ** complex.from_real_imag(2, 0)
if abs(d.real()) > 1e-10 or abs(d.imag() - 2.0) > 1e-10:
print("Power operation failed - expected 0.0+2.0i, got:", d.real(), "+", d.imag(), "i")
return False

# Test equality and hash consistency
c1 = complex.from_real_imag(1.0, 2.0)
Expand Down

0 comments on commit 9b88522

Please sign in to comment.