mirror of
https://github.com/boostorg/math.git
synced 2026-01-28 07:22:12 +00:00
Fixes for multiprecision and expression template enabled types.
[SVN r79851]
This commit is contained in:
@@ -127,7 +127,7 @@ T float_next(const T& val, const Policy& pol)
|
||||
// would not be a denorm, then shift the input, increment, and shift back.
|
||||
// This avoids issues with the Intel SSE2 registers when the FTZ or DAZ flags are set.
|
||||
//
|
||||
return ldexp(float_next(ldexp(val, 2 * tools::digits<T>()), pol), -2 * tools::digits<T>());
|
||||
return ldexp(float_next(T(ldexp(val, 2 * tools::digits<T>())), pol), -2 * tools::digits<T>());
|
||||
}
|
||||
|
||||
if(-0.5f == frexp(val, &expon))
|
||||
@@ -198,7 +198,7 @@ T float_prior(const T& val, const Policy& pol)
|
||||
// would not be a denorm, then shift the input, increment, and shift back.
|
||||
// This avoids issues with the Intel SSE2 registers when the FTZ or DAZ flags are set.
|
||||
//
|
||||
return ldexp(float_prior(ldexp(val, 2 * tools::digits<T>()), pol), -2 * tools::digits<T>());
|
||||
return ldexp(float_prior(T(ldexp(val, 2 * tools::digits<T>())), pol), -2 * tools::digits<T>());
|
||||
}
|
||||
|
||||
T remain = frexp(val, &expon);
|
||||
@@ -323,7 +323,7 @@ T float_distance(const T& a, const T& b, const Policy& pol)
|
||||
//
|
||||
T a2 = ldexp(a, tools::digits<T>());
|
||||
T b2 = ldexp(b, tools::digits<T>());
|
||||
mb = -(std::min)(ldexp(upper, tools::digits<T>()), b2);
|
||||
mb = -(std::min)(T(ldexp(upper, tools::digits<T>())), b2);
|
||||
x = a2 + mb;
|
||||
z = x - a2;
|
||||
y = (a2 - (x - z)) + (mb - z);
|
||||
|
||||
@@ -53,7 +53,7 @@ inline BOOST_CONSTEXPR const char* make_big_value(long double, const char* s, mp
|
||||
// For constants too huge for any conceivable long double (and which generate compiler errors if we try and declare them as such):
|
||||
//
|
||||
#define BOOST_MATH_HUGE_CONSTANT(T, D, x)\
|
||||
boost::math::tools::make_big_value<T>(0.0L, BOOST_STRINGIZE(x), is_floating_point<T>(), boost::is_convertible<const char*, T>())
|
||||
boost::math::tools::make_big_value<T>(0.0L, BOOST_STRINGIZE(x), mpl::bool_<is_floating_point<T>::value || (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::max_exponent <= std::numeric_limits<long double>::max_exponent)>(), boost::is_convertible<const char*, T>())
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
|
||||
Reference in New Issue
Block a user