aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MathFunctions.h
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2019-12-13 22:46:40 +0100
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2019-12-13 22:46:40 +0100
commit8e5da71466591cc24352782b08dc78ddb94f0717 (patch)
treeaca58841231f347657588539e7475f147d8039fd /Eigen/src/Core/MathFunctions.h
parent9b7a2b43c2ccb3d6b89100b7027632157dbf7cee (diff)
Resolve double-promotion warnings when compiling with clang.
`sin` was calling `sin(double)` instead of `std::sin(float)`
Diffstat (limited to 'Eigen/src/Core/MathFunctions.h')
-rw-r--r--Eigen/src/Core/MathFunctions.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h
index dadf2cba2..dde329007 100644
--- a/Eigen/src/Core/MathFunctions.h
+++ b/Eigen/src/Core/MathFunctions.h
@@ -540,8 +540,11 @@ struct expm1_impl<std::complex<RealScalar> > {
// = exp(x) * cos(y) - 1.
// = expm1(x) + exp(x) * (cos(y) - 1)
// = expm1(x) + exp(x) * (2 * sin(y / 2) ** 2)
- RealScalar erm1 = std_fallback::expm1(xr);
+
+ // TODO better use numext::expm1 and numext::sin (but that would require forward declarations or moving this specialization down).
+ RealScalar erm1 = expm1_impl<RealScalar>::run(xr);
RealScalar er = erm1 + RealScalar(1.);
+ EIGEN_USING_STD_MATH(sin);
RealScalar sin2 = sin(xi / RealScalar(2.));
sin2 = sin2 * sin2;
RealScalar s = sin(xi);