summaryrefslogtreecommitdiff
path: root/boost/math/special_functions/zeta.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:41:18 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:43:11 +0900
commitf763a99a501650eff2c60288aa6f10ef916d769e (patch)
tree02af7e13f9a38c888ebf340fe764cbe7dae99da9 /boost/math/special_functions/zeta.hpp
parent5cde13f21d36c7224b0e13d11c4b49379ae5210d (diff)
downloadboost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.gz
boost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.bz2
boost-f763a99a501650eff2c60288aa6f10ef916d769e.zip
Imported Upstream version 1.62.0upstream/1.62.0
Change-Id: I9d4c1ddb7b7d8f0069217ecc582700f9fda6dd4c Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/math/special_functions/zeta.hpp')
-rw-r--r--boost/math/special_functions/zeta.hpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/boost/math/special_functions/zeta.hpp b/boost/math/special_functions/zeta.hpp
index 616bb0cccc..91b83c1b2e 100644
--- a/boost/math/special_functions/zeta.hpp
+++ b/boost/math/special_functions/zeta.hpp
@@ -878,11 +878,19 @@ T zeta_imp_odd_integer(int s, const T&, const Policy&, const mpl::true_&)
template <class T, class Policy>
T zeta_imp_odd_integer(int s, const T& sc, const Policy& pol, const mpl::false_&)
{
- static bool is_init = false;
- static T results[50] = {};
+ static BOOST_MATH_THREAD_LOCAL bool is_init = false;
+ static BOOST_MATH_THREAD_LOCAL T results[50] = {};
+ static BOOST_MATH_THREAD_LOCAL int digits = tools::digits<T>();
+ int current_digits = tools::digits<T>();
+ if(digits != current_digits)
+ {
+ // Oh my precision has changed...
+ is_init = false;
+ }
if(!is_init)
{
is_init = true;
+ digits = current_digits;
for(unsigned k = 0; k < sizeof(results) / sizeof(results[0]); ++k)
{
T arg = k * 2 + 3;