Skip to content

Commit

Permalink
Trying to fix Windows tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rturrado committed Jun 11, 2024
1 parent 1f1f3f6 commit 43a5e2e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/qx/Core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ struct BitIndex {
using BasisVector = utils::Bitset<config::MAX_QUBIT_NUMBER>;

inline constexpr bool isNotNull(std::complex<double> c) {
return std::abs<double>(c.real()) > config::EPS ||
std::abs<double>(c.imag()) > config::EPS;
#if defined(_MSC_VER)
return c.real() > config::EPS ||
-c.real() > config::EPS ||
c.imag() > config::EPS ||
-c.imag() > config::EPS;
#else
return std::abs(c.real()) > config::EPS ||
std::abs(c.imag()) > config::EPS;
#endif
}

struct Complex {
Expand Down

0 comments on commit 43a5e2e

Please sign in to comment.