mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Enable and fix -Wdouble-conversion warnings
This commit is contained in:
@@ -16,7 +16,8 @@ EIGEN_DONT_INLINE Scalar foo(const Scalar& x, const Scalar& y)
|
||||
using namespace std;
|
||||
// return x+std::sin(y);
|
||||
EIGEN_ASM_COMMENT("mybegin");
|
||||
return static_cast<Scalar>(x*2 - 1 + pow(1+x,2) + 2*sqrt(y*y+0) - 4 * sin(0+x) + 2 * cos(y+0) - exp(-0.5*x*x+0));
|
||||
// pow(float, int) promotes to pow(double, double)
|
||||
return x*2 - 1 + static_cast<Scalar>(pow(1+x,2)) + 2*sqrt(y*y+0) - 4 * sin(0+x) + 2 * cos(y+0) - exp(Scalar(-0.5)*x*x+0);
|
||||
//return x+2*y*x;//x*2 -std::pow(x,2);//(2*y/x);// - y*2;
|
||||
EIGEN_ASM_COMMENT("myend");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user