Skip to content

Commit

Permalink
Fix complex operators
Browse files Browse the repository at this point in the history
  • Loading branch information
dancazarin committed Feb 5, 2024
1 parent f0839dc commit 792749a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/unit/math/complex_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ TEST(complex_math)
CHECK(cabs(-3.f) == 3.f);
CHECK(cabs(make_vector(-3.f)) == make_vector(3.f));

CHECK(vec<c32, 4>{ 100, 100, 100, 100 } + vec<c32, 4>{ 1, 2, 3, 4 } == vec<c32, 4>{ 101, 102, 103, 104 });
CHECK(c32{ 100 } + vec<c32, 4>{ 1, 2, 3, 4 } == vec<c32, 4>{ 101, 102, 103, 104 });

CHECK(carg(c32{ +1.f, 0.f }) == 0.f);
CHECK(carg(c32{ 0.f, +1.f }) == c_pi<float> / 2);
CHECK(carg(c32{ 0.f, -1.f }) == -c_pi<float> / 2);
Expand Down

0 comments on commit 792749a

Please sign in to comment.