From 77a4fd97ada4e98fe842b9e777efd8b463ffa2a5 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 19 Jun 2023 18:03:13 +0200 Subject: [PATCH] Fix casting errors --- include/boost/math/special_functions/chebyshev.hpp | 2 +- include/boost/math/special_functions/sqrt1pm1.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/math/special_functions/chebyshev.hpp b/include/boost/math/special_functions/chebyshev.hpp index adfc6bcfeb..ce5579d5be 100644 --- a/include/boost/math/special_functions/chebyshev.hpp +++ b/include/boost/math/special_functions/chebyshev.hpp @@ -53,7 +53,7 @@ template ::value, boo T expt(T p, unsigned q) { using std::pow; - return static_cast(pow(p, q)); + return pow(p, q); } template diff --git a/include/boost/math/special_functions/sqrt1pm1.hpp b/include/boost/math/special_functions/sqrt1pm1.hpp index 293a9d97b3..041916a53f 100644 --- a/include/boost/math/special_functions/sqrt1pm1.hpp +++ b/include/boost/math/special_functions/sqrt1pm1.hpp @@ -26,7 +26,7 @@ inline typename tools::promote_args::type sqrt1pm1(const T& val, const Policy typedef typename tools::promote_args::type result_type; BOOST_MATH_STD_USING - if(fabs(result_type(val)) > 0.75) + if(fabs(result_type(val)) > result_type(0.75)) return sqrt(1 + result_type(val)) - 1; return boost::math::expm1(boost::math::log1p(val, pol) / 2, pol); }