diff --git a/Eigen/src/Core/functors/UnaryFunctors.h b/Eigen/src/Core/functors/UnaryFunctors.h index 28085bc14..f98801294 100644 --- a/Eigen/src/Core/functors/UnaryFunctors.h +++ b/Eigen/src/Core/functors/UnaryFunctors.h @@ -1085,7 +1085,7 @@ struct scalar_unary_pow_op { } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const Scalar& a) const { EIGEN_USING_STD(pow); - return pow(a, m_exponent); + return static_cast(pow(a, m_exponent)); } private: @@ -1096,12 +1096,12 @@ struct scalar_unary_pow_op { template struct scalar_unary_pow_op { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_unary_pow_op(const ScalarExponent& exponent) : m_exponent(exponent) { - EIGEN_STATIC_ASSERT((is_same::value), NON_INTEGER_EXPONENT_MUST_BE_SAME_TYPE_AS_BASE); + EIGEN_STATIC_ASSERT((is_same, std::remove_const_t>::value), NON_INTEGER_EXPONENT_MUST_BE_SAME_TYPE_AS_BASE); EIGEN_STATIC_ASSERT((is_arithmetic::value), EXPONENT_MUST_BE_ARITHMETIC); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& a) const { EIGEN_USING_STD(pow); - return pow(a, m_exponent); + return static_cast(pow(a, m_exponent)); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const {