From b8cf34c691623e4ec329053cbbf68522a855882d Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 5 Dec 2019 15:12:59 +0900 Subject: Imported Upstream version 1.67.0 --- boost/multiprecision/cpp_bin_float/transcendental.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'boost/multiprecision/cpp_bin_float/transcendental.hpp') diff --git a/boost/multiprecision/cpp_bin_float/transcendental.hpp b/boost/multiprecision/cpp_bin_float/transcendental.hpp index 604ed85159..5c969716a5 100644 --- a/boost/multiprecision/cpp_bin_float/transcendental.hpp +++ b/boost/multiprecision/cpp_bin_float/transcendental.hpp @@ -124,13 +124,14 @@ void eval_exp(cpp_bin_float BOOST_ASSERT(t.compare(default_ops::get_constant_ln2 >()) < 0); k = nn ? Exponent(1) << (msb(nn) / 2) : 0; + k = (std::min)(k, (Exponent)(cpp_bin_float::bit_count / 4)); eval_ldexp(t, t, -k); eval_exp_taylor(res, t); // // Square 1 + res k times: // - for(int s = 0; s < k; ++s) + for(Exponent s = 0; s < k; ++s) { t.swap(res); eval_multiply(res, t, t); -- cgit v1.2.3