mirror of
https://github.com/boostorg/math.git
synced 2025-05-11 21:33:52 +00:00
Correct decimal test case.
This commit is contained in:
parent
f3e0cde514
commit
7048e7ccc9
@ -176,12 +176,12 @@ void test_values(const T& val, const char* name)
|
||||
BOOST_CHECK_EQUAL(boost::math::float_advance(val, primes[i]), v1);
|
||||
BOOST_CHECK_EQUAL(boost::math::float_advance(val, -primes[i]), v2);
|
||||
}
|
||||
if(std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::has_infinity))
|
||||
BOOST_IF_CONSTEXPR(std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::has_infinity))
|
||||
{
|
||||
BOOST_CHECK_EQUAL(boost::math::float_prior(std::numeric_limits<T>::infinity()), (std::numeric_limits<T>::max)());
|
||||
BOOST_CHECK_EQUAL(boost::math::float_next(-std::numeric_limits<T>::infinity()), -(std::numeric_limits<T>::max)());
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_prior(-std::numeric_limits<T>::infinity()), std::domain_error);
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_next(std::numeric_limits<T>::infinity()), std::domain_error);
|
||||
BOOST_CHECK_EQUAL(boost::math::float_prior(-std::numeric_limits<T>::infinity()), -std::numeric_limits<T>::infinity());
|
||||
BOOST_CHECK_EQUAL(boost::math::float_next(std::numeric_limits<T>::infinity()), std::numeric_limits<T>::infinity());
|
||||
if(boost::math::policies:: BOOST_MATH_OVERFLOW_ERROR_POLICY == boost::math::policies::throw_on_error)
|
||||
{
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_prior(-(std::numeric_limits<T>::max)()), std::overflow_error);
|
||||
@ -193,6 +193,11 @@ void test_values(const T& val, const char* name)
|
||||
BOOST_CHECK_EQUAL(boost::math::float_next((std::numeric_limits<T>::max)()), std::numeric_limits<T>::infinity());
|
||||
}
|
||||
}
|
||||
BOOST_IF_CONSTEXPR(std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::has_quiet_NaN))
|
||||
{
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_prior(std::numeric_limits<T>::quiet_NaN()), std::domain_error);
|
||||
BOOST_MATH_CHECK_THROW(boost::math::float_next(std::numeric_limits<T>::quiet_NaN()), std::domain_error);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
|
Loading…
x
Reference in New Issue
Block a user