Boost logo

Boost :

Subject: Re: [boost] boost-test, why is there no DOUBLES_EQUAL?
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2011-04-08 07:50:20


Gennadiy Rozental wrote:
> Sebastian Nowozin <nowozin <at> gmail.com> writes:
>
>> This does not do the job, as
>> BOOST_CHECK_SMALL(std::fabs(first - second), 1.0e-3)
>> will be about as useful as
>> BOOST_CHECK(std::fabs(first - second) <= 1.0e-3)
>>
>> It is not useful because in case this check fails I do not get to see
>> the original values of both 'first' and 'second', but only their
>> difference.
>
> That's what you get for using suboptimal testing approach ;)

Can you give an example or reference on a more optimal approach?

Thanks, Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk