2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-28 07:22:12 +00:00

Tentative fix for gcc-4.7 and earlier failures.

This commit is contained in:
jzmaddock
2014-03-21 11:36:57 +00:00
parent 6f47470274
commit 200f384c14

View File

@@ -103,7 +103,7 @@ T float_next_imp(const T& val, const Policy& pol)
int fpclass = (boost::math::fpclassify)(val);
if((fpclass == FP_NAN) || (fpclass == FP_INFINITE))
if((fpclass == (int)FP_NAN) || (fpclass == (int)FP_INFINITE))
{
if(val < 0)
return -tools::max_value<T>();
@@ -118,7 +118,7 @@ T float_next_imp(const T& val, const Policy& pol)
if(val == 0)
return detail::get_smallest_value<T>();
if((fpclass != FP_SUBNORMAL) && (fpclass != FP_ZERO) && (fabs(val) < detail::get_min_shift_value<T>()) && (val != -tools::min_value<T>()))
if((fpclass != (int)FP_SUBNORMAL) && (fpclass != (int)FP_ZERO) && (fabs(val) < detail::get_min_shift_value<T>()) && (val != -tools::min_value<T>()))
{
//
// Special case: if the value of the least significant bit is a denorm, and the result
@@ -185,7 +185,7 @@ T float_prior_imp(const T& val, const Policy& pol)
int fpclass = (boost::math::fpclassify)(val);
if((fpclass == FP_NAN) || (fpclass == FP_INFINITE))
if((fpclass == (int)FP_NAN) || (fpclass == (int)FP_INFINITE))
{
if(val > 0)
return tools::max_value<T>();
@@ -200,7 +200,7 @@ T float_prior_imp(const T& val, const Policy& pol)
if(val == 0)
return -detail::get_smallest_value<T>();
if((fpclass != FP_SUBNORMAL) && (fpclass != FP_ZERO) && (fabs(val) < detail::get_min_shift_value<T>()) && (val != tools::min_value<T>()))
if((fpclass != (int)FP_SUBNORMAL) && (fpclass != (int)FP_ZERO) && (fabs(val) < detail::get_min_shift_value<T>()) && (val != tools::min_value<T>()))
{
//
// Special case: if the value of the least significant bit is a denorm, and the result
@@ -318,7 +318,7 @@ T float_distance_imp(const T& a, const T& b, const Policy& pol)
// because we actually have fewer than tools::digits<T>()
// significant bits in the representation:
//
frexp(((boost::math::fpclassify)(a) == FP_SUBNORMAL) ? tools::min_value<T>() : a, &expon);
frexp(((boost::math::fpclassify)(a) == (int)FP_SUBNORMAL) ? tools::min_value<T>() : a, &expon);
T upper = ldexp(T(1), expon);
T result = 0;
expon = tools::digits<T>() - expon;
@@ -335,7 +335,7 @@ T float_distance_imp(const T& a, const T& b, const Policy& pol)
// errors in the subtraction:
//
T mb, x, y, z;
if(((boost::math::fpclassify)(a) == FP_SUBNORMAL) || (b - a < tools::min_value<T>()))
if(((boost::math::fpclassify)(a) == (int)FP_SUBNORMAL) || (b - a < tools::min_value<T>()))
{
//
// Special case - either one end of the range is a denormal, or else the difference is.
@@ -399,7 +399,7 @@ T float_advance_imp(T val, int distance, const Policy& pol)
int fpclass = (boost::math::fpclassify)(val);
if((fpclass == FP_NAN) || (fpclass == FP_INFINITE))
if((fpclass == (int)FP_NAN) || (fpclass == (int)FP_INFINITE))
return policies::raise_domain_error<T>(
function,
"Argument val must be finite, but got %1%", val, pol);