2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 16:32:10 +00:00

Fix first test case from https://github.com/boostorg/math/issues/1198 and add test case.

This commit is contained in:
jzmaddock
2025-03-28 18:19:42 +00:00
parent a5c062542a
commit 4d58e93b5d
2 changed files with 9 additions and 2 deletions

View File

@@ -191,10 +191,10 @@ namespace boost
//
T last_term = 0;
boost::math::uintmax_t count = 0;
for(auto i = k + 1; ; ++i)
for(long long i = k + 1; ; ++i)
{
poisf *= l2 / i;
xtermf *= (x * (a + b + i - 2)) / (a + i - 1);
xtermf *= (x * (a + b + (i - 2))) / (a + (i - 1));
betaf += xtermf;
T term = poisf * betaf;

View File

@@ -314,6 +314,13 @@ void test_spots(RealType)
BOOST_CHECK(boost::math::isnan(pdf(d2, 0.5)));
BOOST_CHECK(boost::math::isnan(cdf(d2, 0.5)));
}
//
// See https://github.com/boostorg/math/issues/1198
//
if (std::numeric_limits<RealType>::max_exponent10 >= 100)
{
BOOST_CHECK_CLOSE(cdf(boost::math::non_central_f_distribution<RealType>(static_cast<RealType>(1e-100L), 3.f, 1.5f), static_cast<RealType>(1e100L)), static_cast<RealType>(0.6118152873453990639132215575213809716459L), tolerance);
}
} // template <class RealType>void test_spots(RealType)
BOOST_AUTO_TEST_CASE( test_main )