diff --git a/test/main.h b/test/main.h index 07f3794ac..3dd094249 100644 --- a/test/main.h +++ b/test/main.h @@ -422,7 +422,13 @@ template<> inline long double test_precision >() { ret #define EIGEN_TEST_SCALAR_TEST_OVERLOAD(TYPE) \ inline bool test_isApprox(TYPE a, TYPE b) \ - { return internal::isApprox(a, b, test_precision()); } \ + { return numext::equal_strict(a, b) || \ + ((numext::isnan)(a) && (numext::isnan)(b)) || \ + (internal::isApprox(a, b, test_precision())); } \ + inline bool test_isCwiseApprox(TYPE a, TYPE b, bool exact) \ + { return numext::equal_strict(a, b) || \ + ((numext::isnan)(a) && (numext::isnan)(b)) || \ + (!exact && internal::isApprox(a, b, test_precision())); } \ inline bool test_isMuchSmallerThan(TYPE a, TYPE b) \ { return internal::isMuchSmallerThan(a, b, test_precision()); } \ inline bool test_isApproxOrLessThan(TYPE a, TYPE b) \