fixed: adjust compare_at_tolerance namespace for earlier boost

This commit is contained in:
Arne Morten Kvarving 2023-11-10 10:17:54 +01:00
parent f8781f276e
commit 2fec8a3c16

View File

@ -101,7 +101,11 @@ void testAllComponents()
template<class Scalar>
bool close_at_tolerance(Scalar n1, Scalar n2, Scalar tolerance)
{
#if BOOST_VERSION / 100000 == 1 && BOOST_VERSION / 100 % 1000 < 71
auto comp = boost::test_tools::close_at_tolerance<Scalar>(boost::test_tools::percent_tolerance_t<Scalar>(tolerance*100.0));
#else
auto comp = boost::math::fpc::close_at_tolerance<Scalar>(tolerance);
#endif
return comp(n1, n2);
}