summaryrefslogtreecommitdiff
path: root/boost/multiprecision/cpp_bin_float/transcendental.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/multiprecision/cpp_bin_float/transcendental.hpp
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-upstream/1.67.0.tar.gz
boost-upstream/1.67.0.tar.bz2
boost-upstream/1.67.0.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/multiprecision/cpp_bin_float/transcendental.hpp')
-rw-r--r--boost/multiprecision/cpp_bin_float/transcendental.hpp3
1 files changed, 2 insertions, 1 deletions
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<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>
BOOST_ASSERT(t.compare(default_ops::get_constant_ln2<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE> >()) < 0);
k = nn ? Exponent(1) << (msb(nn) / 2) : 0;
+ k = (std::min)(k, (Exponent)(cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinE, MaxE>::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);