Boost logo

Boost Users :

From: Ross Boylan (ross_at_[hidden])
Date: 2004-09-30 16:38:17


I get the following error
Specification_test.cc(22): error in "specsimple": difference between
spec(i, j){0.206788} and results[k]{0.206788} exceeds 1e-05%

The numbers agree to all printed digits. I get a maximum relative
error (assuming the printed values are rounded from extremes)*(see
footnote) of .000001/.206787 = 4.8e-6 < 1e-5. Even doubling this is
under the tolerance.

As I read the documentation, this should pass.

1e-6 tolerance produces a lot more discrepancies; 1e-4 says they are
all OK.

Have I misunderstood something, or is something funny going on? In
particular, the "%" after "1e-5" in the error message suggests the
tolerances are supposed to be in percentage terms, i.e, 1e-5 implies a
real tolerance of 1e-7. That would explain things, but I see nothing
in the documentation to suggest the tolerance value is a percent.
(Well, the docs do say the tolerance can be an integer.)

The relevant line is
      BOOST_CHECK_CLOSE(spec(i, j), results[k], tol);
All relevant quantities are doubles.

It may be relevant that the program under test includes <cmath>.
Debian package libboost-dev 1.31.0-7 on an Athlon system.
# g++ --version
g++.real (GCC) 3.3.4 (Debian 1:3.3.4-6sarge1)
Linux kernel 2.4.26

* In fact, the results value is coded as 0.2067880 in the program, so
my calculation likely gives double the possible discrepancy.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net