mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Coverage: last few lines of next.hpp.
This commit is contained in:
@@ -844,8 +844,8 @@ T float_advance_imp(T val, int distance, const std::false_type&, const Policy& p
|
||||
}
|
||||
else
|
||||
{
|
||||
limit *= std::numeric_limits<T>::radix;
|
||||
expon++;
|
||||
limit *= std::numeric_limits<T>::radix; // LCOV_EXCL_LINE Probably unreachable for the decimal types we have?
|
||||
expon++; // LCOV_EXCL_LINE
|
||||
}
|
||||
limit_distance = float_distance(val, limit);
|
||||
if(distance && (limit_distance == 0))
|
||||
|
||||
@@ -193,11 +193,17 @@ void test_values(const T& val, const char* name)
|
||||
{
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_prior(-(std::numeric_limits<T>::max)()), std::overflow_error);
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_next((std::numeric_limits<T>::max)()), std::overflow_error);
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_advance(std::numeric_limits<T>::infinity(), 2), std::domain_error);
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_advance(-std::numeric_limits<T>::infinity(), 2), std::domain_error);
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_advance(std::numeric_limits<T>::infinity(), -2), std::domain_error);
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_advance(-std::numeric_limits<T>::infinity(), -2), std::domain_error);
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_CHECK_EQUAL(boost::math::float_prior(-(std::numeric_limits<T>::max)()), -std::numeric_limits<T>::infinity());
|
||||
BOOST_CHECK_EQUAL(boost::math::float_next((std::numeric_limits<T>::max)()), std::numeric_limits<T>::infinity());
|
||||
BOOST_CHECK((boost::math::isnan)(boost::math::float_advance(std::numeric_limits<T>::quiet_NaN(), 2)));
|
||||
BOOST_CHECK((boost::math::isnan)(boost::math::float_advance(std::numeric_limits<T>::quiet_NaN(), -2)));
|
||||
}
|
||||
}
|
||||
BOOST_IF_CONSTEXPR(std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::has_quiet_NaN))
|
||||
|
||||
Reference in New Issue
Block a user