
27 Jul
2004
27 Jul
'04
4:58 p.m.
Hi, I want to use the boost::test floating-point comparison algorithms (Boost 1.31.0) and wrote the following simple lines of code: double d1 = 0.2; double d2 = 0.8; double d3 = d2-d1-d1-d1-d1; // d3 should be zero bool b = boost::test_toolbox::check_is_closed( d3, 0., 1e-3 ); To my surprise, the return value b is FALSE, although d3 should be _very_ close to zero (and is 5.55112e-17 on my machine). Am I missing something or is this a bug in the test library? Thanks, Michael -- Michael Kettner kettner@ive.uni-hannover.de