Subject: Re: [boost] [test] floating point comparison
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2015-04-27 17:31:18
Le 26/04/15 22:22, Emil Dotchevski a écrit :
> On Sun, Apr 26, 2015 at 12:14 AM, Gennadiy Rozental <rogeeff_at_[hidden]>
>> Emil Dotchevski <emildotchevski <at> gmail.com> writes:
>>> Can someone please tell me exactly what do I need to include and which
>>> namespace to use to get exact same behavior as:
>>> #include <boost/test/floating_point_comparison.hpp>
>>> bool check( float a, float b, float tolerance )
>>> using namespace boost::test_tools;
>>> return check_is_close(a,b,fraction_tolerance(tolerance));
>>> (The above used to work with older Boost versions but no longer.)
>> Do you refer to the develop branch?
>> BOOST_TEST(a==b, tolerance);
>> should do the same.
> Yes, sorry -- I mean the development branch.
> Could you provide a replacement for the function above? Note that it
> returns a value, which isn't the same as BOOST_TEST. Also please indicate
> what headers need to be included.
The corresponding documentation has been updated recently:
Those pages indicate the required headers and namespaces.
BOOST_TEST is using this predicate, so would you please give me some
more info about "Note that it returns a value, which isn't the same as
The corresponding equivalent code should be
bool check( float a, float b, float tolerance )
using namespace boost::math::fpc;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk