Consider inf/nan in scalar test_isApprox.

This commit is contained in:
Antonio Sánchez 2022-04-01 17:00:24 +00:00 committed by Rasmus Munk Larsen
parent 1ddd3e29cb
commit 0c859cf35d

View File

@ -424,7 +424,9 @@ template<> inline long double test_precision<std::complex<long double> >() { ret
#define EIGEN_TEST_SCALAR_TEST_OVERLOAD(TYPE) \
inline bool test_isApprox(TYPE a, TYPE b) \
{ return internal::isApprox(a, b, test_precision<TYPE>()); } \
{ return numext::equal_strict(a, b) || \
((numext::isnan)(a) && (numext::isnan)(b)) || \
(internal::isApprox(a, b, test_precision<TYPE>())); } \
inline bool test_isCwiseApprox(TYPE a, TYPE b, bool exact) \
{ return numext::equal_strict(a, b) || \
((numext::isnan)(a) && (numext::isnan)(b)) || \