Subject: [Boost-bugs] [Boost C++ Libraries] #2268: BOOST_CHECK_CLOSE returns only errors
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-08-28 15:10:43
#2268: BOOST_CHECK_CLOSE returns only errors
--------------------------------------------------------+-------------------
Reporter: Michael Schmid <michaelschmid1_at_[hidden]> | Type: Bugs
Status: new | Milestone: Boost 1.37.0
Component: None | Version: Boost 1.36.0
Severity: Problem | Keywords: BOOST_CHECK_CLOSE
--------------------------------------------------------+-------------------
Hi all
This is my first bug report (ticket) to the boost developer team or to
whom it may concern. So please don't be angry about some mistakes :-)
I think I have found a bug in the test library.
I have to check some double values near zero.
The first one seems to be ok:
{{{
BOOST_CHECK_CLOSE( P(0,0), PostMatrix(0,0), 1e-20 );
}}}
This returns:
../src/nnetDataProcessingTest.h(341): error in
"NnetDataProcessing_testPostStd1": difference between P(0,0){1} and
PostMatrix(0,0){0.99999999999999978} exceeds 1e-20%
If I set the tolerance to 1e-6, everything is ok!
Now, the second one seems to contain the bug:
{{{
BOOST_CHECK_CLOSE(0.0,-2.3093506e-17,1);
}}}
You see, I have written some double values directly in the
BOOST_CHECK_CLOSE to be sure I don't have a mistake somewhere else.
The tolerance is set to 1%! But even though I get following message:
''''''../src/nnetDataProcessingTest.h(361): error in
"NnetDataProcessing_testPostStd1": difference between 0.0{0} and
-2.3093506e-17{-2.3093506000000001e-17} exceeds 1%''''''
This is not the expected result?
Waht's wrong here. Is this my mistake? Or is it really a bug?
Thanks for any help
Michael
-- Ticket URL: <http://svn.boost.org/trac/boost/ticket/2268> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC