From 3d59ae02031c1aab8fbaa4457f06d31d9e9b2414 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 27 Mar 2015 09:59:24 +0100 Subject: Fix hypot(0,0). --- Eigen/src/Core/MathFunctions.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Eigen/src') diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index e1b233d82..3c240c272 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -328,6 +328,7 @@ struct hypot_impl p = _y; qp = _x / p; } + if(p==RealScalar(0)) return RealScalar(0); return p * sqrt(RealScalar(1) + qp*qp); } }; -- cgit v1.2.3