From 0c859cf35d67fe2abf8bc79810e88732429fc88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= Date: Fri, 1 Apr 2022 17:00:24 +0000 Subject: [PATCH] Consider inf/nan in scalar test_isApprox. --- test/main.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/main.h b/test/main.h index dd46c0047..8eead7cd7 100644 --- a/test/main.h +++ b/test/main.h @@ -424,7 +424,9 @@ 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)) || \