diff --git a/include/boost/math/special_functions/detail/bernoulli_details.hpp b/include/boost/math/special_functions/detail/bernoulli_details.hpp index 49fa6089c..36e7a7ac6 100644 --- a/include/boost/math/special_functions/detail/bernoulli_details.hpp +++ b/include/boost/math/special_functions/detail/bernoulli_details.hpp @@ -328,7 +328,7 @@ public: typename container_type::size_type old_size = bn.size(); tangent(m); - bn.resize(m); + bn.resize(static_cast(m)); if(!old_size) { @@ -355,7 +355,7 @@ public: while(i < m) { b = std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : tools::max_value(); - bn[i] = ((i % 2) ? b : -b); + bn[static_cast(i)] = ((i % 2U) ? b : -b); ++i; } break; @@ -367,9 +367,9 @@ public: power_two = ldexp(power_two, 2); - const bool b_neg = i % 2 == 0; + const bool b_neg = ((i % 2U) == 0); - bn[i] = ((!b_neg) ? b : -b); + bn[static_cast(i)] = ((!b_neg) ? b : -b); } } @@ -400,7 +400,7 @@ public: { for(; n; ++start, --n) { - *out = b2n_asymptotic(start); + *out = b2n_asymptotic(static_cast(start)); ++out; } } @@ -467,7 +467,7 @@ public: for(std::size_t i = (std::max)(static_cast(max_bernoulli_b2n::value + 1), start); i < start + n; ++i) { - *out = (i >= m_overflow_limit) ? policies::raise_overflow_error("boost::math::bernoulli_b2n<%1%>(std::size_t)", 0, pol) : bn[i]; + *out = (i >= m_overflow_limit) ? policies::raise_overflow_error("boost::math::bernoulli_b2n<%1%>(std::size_t)", 0, pol) : bn[static_cast(i)]; ++out; } @@ -503,7 +503,7 @@ public: { for(; n; ++start, --n) { - *out = t2n_asymptotic(start); + *out = t2n_asymptotic(static_cast(start)); ++out; } }