Skip to content

Commit d684148

Browse files
committed
add check
1 parent 955f349 commit d684148

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sycl/test-e2e/DeviceLib/exp/exp-std-complex-edge-cases.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ template <typename T> bool test() {
222222
for (unsigned i = 0; i < N; ++i) {
223223
std::complex<T> r = acc[i];
224224
// If z is (+/-0, +0), the result is (1, +0)
225-
if (testcases[i].real() == 0 && testcases[i].imag() == 0) {
225+
if (testcases[i].real() == 0 && testcases[i].imag() == 0 &&
226+
!std::signbit(testcases[i].imag())) {
226227
CHECK(r.real() == 1.0, passed, i);
227228
CHECK(r.imag() == 0, passed, i);
228229
CHECK(std::signbit(testcases[i].imag()) == std::signbit(r.imag()),

0 commit comments

Comments
 (0)