diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 0be6de71f..311808187 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -946,12 +946,13 @@ T (floor)(const T& x) return floor(x); } +#ifdef EIGEN_HAS_C99_MATH template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float floor(const float &x) { return ::floorf(x); } template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE double floor(const double &x) { return ::floor(x); } - +#endif template EIGEN_DEVICE_FUNC @@ -999,12 +1000,13 @@ T log(const T &x) { return log(x); } +#ifdef EIGEN_HAS_C99_MATH template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float log(const float &x) { return ::logf(x); } template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE double log(const double &x) { return ::log(x); } - +#endif template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE @@ -1013,12 +1015,13 @@ T tan(const T &x) { return tan(x); } +#ifdef EIGEN_HAS_C99_MATH template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float tan(const float &x) { return ::tanf(x); } template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE double tan(const double &x) { return ::tan(x); } - +#endif template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE @@ -1027,12 +1030,13 @@ T abs(const T &x) { return abs(x); } +#ifdef EIGEN_HAS_C99_MATH template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float abs(const float &x) { return ::fabsf(x); } template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE double abs(const double &x) { return ::fabs(x); } - +#endif template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE @@ -1041,11 +1045,13 @@ T exp(const T &x) { return exp(x); } +#ifdef EIGEN_HAS_C99_MATH template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float exp(const float &x) { return ::expf(x); } template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE double exp(const double &x) { return ::exp(x); } +#endif } // end namespace numext diff --git a/Eigen/src/Core/SpecialFunctions.h b/Eigen/src/Core/SpecialFunctions.h index c01a88d18..c12e41a7b 100644 --- a/Eigen/src/Core/SpecialFunctions.h +++ b/Eigen/src/Core/SpecialFunctions.h @@ -284,7 +284,7 @@ struct digamma_impl { bool negative; const Scalar maxnum = NumTraits::infinity(); - const Scalar m_pi = 3.14159265358979323846; + const Scalar m_pi = EIGEN_PI; negative = 0; nz = 0.0;