mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-24 14:45:14 +08:00
Don't use M_PI since it's only guaranteed to be defined in Eigen/Geometry
This commit is contained in:
parent
83e5b7656b
commit
085aa8e601
@ -421,7 +421,8 @@ struct round_retval
|
||||
EIGEN_DEVICE_FUNC
|
||||
static inline RealScalar run(const Scalar& x)
|
||||
{
|
||||
return (x < 0.0) ? M_PI : 0.0; }
|
||||
const double pi = std::acos(-1.0);
|
||||
return (x < 0.0) ? pi : 0.0; }
|
||||
};
|
||||
|
||||
template<typename Scalar>
|
||||
|
@ -237,7 +237,7 @@ template<typename ArrayType> void array_real(const ArrayType& m)
|
||||
VERIFY_IS_APPROX(sinh(m1), 0.5*(exp(m1)-exp(-m1)));
|
||||
VERIFY_IS_APPROX(cosh(m1), 0.5*(exp(m1)+exp(-m1)));
|
||||
VERIFY_IS_APPROX(tanh(m1), (0.5*(exp(m1)-exp(-m1)))/(0.5*(exp(m1)+exp(-m1))));
|
||||
VERIFY_IS_APPROX(arg(m1), ((ArrayType)(m1<0))*M_PI);
|
||||
VERIFY_IS_APPROX(arg(m1), ((ArrayType)(m1<0))*std::acos(-1.0));
|
||||
VERIFY((round(m1) <= ceil(m1) && round(m1) >= floor(m1)).all());
|
||||
VERIFY(isNaN(m1*0.0/0.0).all());
|
||||
VERIFY(isInf(m1/0.0).all());
|
||||
|
Loading…
Reference in New Issue
Block a user