From 93a62265dc0130d23fa5cf40f55e6dd12badfbef Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 10 Jun 2015 16:19:10 +0200 Subject: [PATCH] fix isinf(complex(inf,NaN)) to return false. --- Eigen/src/Core/MathFunctions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index dfdca4f94..a2337e216 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -841,7 +841,7 @@ template EIGEN_DEVICE_FUNC bool (isinf)(const std::complex& x) { - return numext::isinf(numext::real(x)) || numext::isinf(numext::imag(x)); + return (numext::isinf(numext::real(x)) || numext::isinf(numext::imag(x))) && (!numext::isnan(x)); } template