diff --git a/include/boost/math/tools/precision.hpp b/include/boost/math/tools/precision.hpp index 94c22b55ed..fac022f53a 100644 --- a/include/boost/math/tools/precision.hpp +++ b/include/boost/math/tools/precision.hpp @@ -182,9 +182,13 @@ struct log_limit_traits { typedef typename boost::math::conditional< (boost::math::numeric_limits::radix == 2) && - (boost::math::numeric_limits::max_exponent == 128 - || boost::math::numeric_limits::max_exponent == 1024 - || boost::math::numeric_limits::max_exponent == 16384), + ( + ( boost::math::numeric_limits::max_exponent == 128 + || boost::math::numeric_limits::max_exponent == 1024 + || boost::math::numeric_limits::max_exponent == 16384 + ) + && (-boost::math::numeric_limits::min_exponent + 1 == boost::math::numeric_limits::max_exponent) + ), boost::math::integral_constant::max_exponent > (boost::math::numeric_limits::max)() ? (boost::math::numeric_limits::max)() : static_cast(boost::math::numeric_limits::max_exponent))>, boost::math::integral_constant >::type tag_type; diff --git a/test/test_bessel_k.hpp b/test/test_bessel_k.hpp index 6a2a8179d9..66e648b459 100644 --- a/test/test_bessel_k.hpp +++ b/test/test_bessel_k.hpp @@ -133,7 +133,9 @@ void test_bessel(T, const char* name) {{ SC_(-10.0), SC_(1.0), SC_(1.80713289901029454691597861302340015908245782948536080022119e8) }}, {{ SC_(100.0), SC_(5.0), SC_(7.03986019306167654653386616796116726248616158936088056952477e115) }}, {{ SC_(100.0), SC_(80.0), SC_(8.39287107246490782848985384895907681748152272748337807033319e-12) }}, - {{ SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) }}, + ((std::numeric_limits::is_specialized) && (std::numeric_limits::min_exponent10 > -293)) + ? std::array::type, 3> {{ SC_(-1000.0), SC_(664.0), SC_(0.00372564418019942154373086796021082031912651177619335584767976) }} + : std::array::type, 3> {{ SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) }}, }}; static const std::array::type, 3>, 11> kv_data = {{ {{ SC_(0.5), SC_(0.875), SC_(0.558532231646608646115729767013630967055657943463362504577189) }},