
16 Feb
2007
16 Feb
'07
5:07 p.m.
Hugo Duncan wrote:
Hi,
Just to chime in with my problems using BOOST_CHECK_CLOSE ...
I always have problems when checking for small numbers or zero. I write something like BOOST_CHECK_CLOSE(0,x,1e-5) and start wondering why it fails, then rewrite the test using an epsilon value.
When I know the value is going to be near zero this is ok, but sometimes tests are written for computed values. A possible solution would be to have a check that uses the maximum of a relative and an absolute tolerance.
Whatever it is, that's a different test. I certainly have lots of existing tests that require say a N epsilon max error irrespective of how small the value is. John.