BOOST_TEST_EQ diagnostic for floating point types lacks precision
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start with the supplied reproducer and read boost/core/lightweight_test.hpp, where BOOST_TEST_EQ produces the diagnostic. Compare its reported values with the high-precision std::cerr output. Done means the diagnostic distinguishes the two floating-point values rather than printing both as 0.0012.
Written by the indexing model from the issue text.
Description
#include <boost/core/lightweight_test.hpp>
#include <limits>
int main()
{
BOOST_TEST_EQ(0x9.d495182a99318p-13, 0x9.d495182a99308p-13);
std::cerr.precision(std::numeric_limits<double>::max_digits10);
std::cerr << 0x9.d495182a99318p-13 << " == " << 0x9.d495182a99308p-13 << '\n';
return boost::report_errors();
}
prog.cc(5): test '0x9.d495182a99318p-13 == 0x9.d495182a99308p-13' ('0.0012' == '0.0012') failed in function 'int main()'
0.0012000000000000003 == 0.0011999999999999999
- Dominant language
- C++
- Stars
- 156
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/core
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
-
saturate_cast Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100