aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/autodiff.cpp
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2016-05-05 13:35:45 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2016-05-05 13:35:45 +0200
commitdacb469bc93b5b8578afad19d327606659ec3a55 (patch)
tree8fdff5d859a812adfcc8ff01826b5be3096bff05 /unsupported/test/autodiff.cpp
parent62b710072e282ad70bbcb38468367f7f99232d32 (diff)
Enable and fix -Wdouble-conversion warnings
Diffstat (limited to 'unsupported/test/autodiff.cpp')
-rw-r--r--unsupported/test/autodiff.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/unsupported/test/autodiff.cpp b/unsupported/test/autodiff.cpp
index 374f86df9..c4606cd17 100644
--- a/unsupported/test/autodiff.cpp
+++ b/unsupported/test/autodiff.cpp
@@ -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");
}