From be78aea6b3d2443d1c614a0da7a56dfefbad4520 Mon Sep 17 00:00:00 2001 From: Ola Røer Thorsen Date: Wed, 4 May 2016 10:52:08 +0200 Subject: fix double-promotion/float-conversion in Core/SpecialFunctions.h --- Eigen/src/Core/SpecialFunctions.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Eigen/src/Core') diff --git a/Eigen/src/Core/SpecialFunctions.h b/Eigen/src/Core/SpecialFunctions.h index 3513a5c63..c6a50bb1d 100644 --- a/Eigen/src/Core/SpecialFunctions.h +++ b/Eigen/src/Core/SpecialFunctions.h @@ -284,7 +284,7 @@ struct digamma_impl { bool negative = false; const Scalar maxnum = NumTraits::infinity(); - const Scalar m_pi(EIGEN_PI); + const Scalar m_pi = Scalar(EIGEN_PI); const Scalar zero = Scalar(0); const Scalar one = Scalar(1); @@ -441,7 +441,7 @@ struct igamma_helper { EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE float big() { // use epsneg (1.0 - epsneg == 1.0) - return 1.0 / (NumTraits::epsilon() / 2); + return 1.0f / (NumTraits::epsilon() / 2); } }; @@ -742,7 +742,7 @@ struct igamma_impl { const Scalar machep = igamma_helper::machep(); const Scalar maxlog = numext::log(NumTraits::highest()); - double ans, ax, c, r; + Scalar ans, ax, c, r; /* Compute x**a * exp(-x) / gamma(a) */ ax = a * numext::log(x) - x - lgamma_impl::run(a); -- cgit v1.2.3