From 9c95d794fcd6127446cdd4b0273e1fbb67de4688 Mon Sep 17 00:00:00 2001 From: Jakob Riedle Date: Thu, 17 Sep 2020 13:54:06 +0200 Subject: [PATCH] Fixed [-Wimplicit-int-float-conversion] Fixed [-Wimplicit-int-float-conversion] as in: boost/math/special_functions/trunc.hpp:65:12: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-int-float-conversion] if((r > (std::numeric_limits::max)()) || (r < (std::numeric_limits::min)())) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- include/boost/math/special_functions/trunc.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/math/special_functions/trunc.hpp b/include/boost/math/special_functions/trunc.hpp index d4d322991d..234a3549a9 100644 --- a/include/boost/math/special_functions/trunc.hpp +++ b/include/boost/math/special_functions/trunc.hpp @@ -62,7 +62,7 @@ inline int itrunc(const T& v, const Policy& pol) BOOST_MATH_STD_USING typedef typename tools::promote_args::type result_type; result_type r = boost::math::trunc(v, pol); - if((r > (std::numeric_limits::max)()) || (r < (std::numeric_limits::min)())) + if((r > (result_type)(std::numeric_limits::max)()) || (r < (result_type)(std::numeric_limits::min)())) return static_cast(policies::raise_rounding_error("boost::math::itrunc<%1%>(%1%)", 0, static_cast(v), 0, pol)); return static_cast(r); }