Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83413 - trunk/libs/math/example
From: pbristow_at_[hidden]
Date: 2013-03-12 13:51:36


Author: pbristow
Date: 2013-03-12 13:51:35 EDT (Tue, 12 Mar 2013)
New Revision: 83413
URL: http://svn.boost.org/trac/boost/changeset/83413

Log:
Corrected wrong tolerance for check close percent and fraction.
Text files modified:
   trunk/libs/math/example/test_cpp_float_close_fraction.cpp | 13 +++++--------
   1 files changed, 5 insertions(+), 8 deletions(-)

Modified: trunk/libs/math/example/test_cpp_float_close_fraction.cpp
==============================================================================
--- trunk/libs/math/example/test_cpp_float_close_fraction.cpp (original)
+++ trunk/libs/math/example/test_cpp_float_close_fraction.cpp 2013-03-12 13:51:35 EDT (Tue, 12 Mar 2013)
@@ -65,8 +65,8 @@
 
   std::cout <<"a = " << a << ",\nb = " << b << ",\neps = " << eps << std::endl;
 
- BOOST_CHECK_CLOSE(a, b, eps); // Expected to pass (because tolerance is as percent).
- // BOOST_CHECK_CLOSE_FRACTION(a, b, eps); // Expected to fail.
+ BOOST_CHECK_CLOSE(a, b, eps * 100); // Expected to pass (because tolerance is as percent).
+ BOOST_CHECK_CLOSE_FRACTION(a, b, eps); // Expected to pass (because tolerance is as fraction).
 
 /*`Using `cpp_dec_float_50` with the default expression template use switched on,
   the compiler error message for `BOOST_CHECK_CLOSE_FRACTION(a, b, eps); would be:
@@ -88,12 +88,9 @@
   a = 1.0000000000000000000000000000000000000000000000000,
   b = 1.0000000000000000000000000000000000000000000000001,
   eps = 1.0000000000000000000000000000000000000000000000000e-49
-test_cpp_float_close_fraction.cpp(68): error : in "cpp_float_test_check_close":
-difference{1e-49%} between
- a{1}
-and
- b{1.0000000000000000000000000000000000000000000000001} exceeds 1e-49%
   
- *** 1 failure detected in test module "Master Test Suite"
+ *** No errors detected
+
+
 */
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk