You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to section tolerance-based comparisons, function BOOST_CHECK_CLOSE does a relative comparison and evaluates to assert(abs(x - y)/abs(x) <= tol && abs(x - y)/abs(y) <= tol) when both x and y are non-zero.
In the binary, ::boost::math::fpc::percent_tolerance(std::numeric_limits<double>::epsilon()) is used as the epsilon value, where percent_tolerance() divides by 100 while percent_tolerance_t() doesn't (according to section tolerance (decorator)). Here is a MWE:
#defineBOOST_TEST_MODULE tolerance test
#defineBOOST_TEST_DYN_LINK
#include<boost/test/unit_test.hpp>/* compile with g++ test.cc -lboost_unit_test_framework */BOOST_AUTO_TEST_CASE(tolerance)
{
BOOST_CHECK_CLOSE(1, 1.01 - 1e-8, 1); // passes: slightly less than 1%BOOST_CHECK_CLOSE(1, 1.01 + 1e-8, 1); // fails: slightly more than 1%
}
BOOST_CHECK_CLOSE
takes a percentage as tolerance. Epsilon values must be multiplied by 100.In this example, the first line is incorrect:
espresso/src/utils/tests/int_pow_test.cpp
Lines 43 to 44 in d553bd5
In this example, the line is correct:
espresso/src/utils/tests/interpolation_test.cpp
Line 254 in d553bd5
This affects both 4.1 and 4.2.
The text was updated successfully, but these errors were encountered: