diff --git a/debug.hpp b/debug.hpp index b0a260e2..2e90f6cf 100644 --- a/debug.hpp +++ b/debug.hpp @@ -199,6 +199,23 @@ } while (0) +/////////////////////////////////////////////////////////////////////////////// +#define CHECK_NEZ(A) do { \ + DEBUG_ONLY( \ + const auto __a = (A); \ + _CHECK_META (!almost_zero (__a), \ + { ; }, \ + { \ + std::ostringstream __debug_nez_os; \ + __debug_nez_os << "unexpected zero.\n" \ + << "__a: " << #A << " is " << __a << ")"; \ + panic (__debug_nez_os.str ()); \ + }); \ + ); \ +} while (0) + + + /////////////////////////////////////////////////////////////////////////////// #define CHECK_THROWS(E,C) do { \ DEBUG_ONLY( \