|
Boost : |
Subject: Re: [boost] [test] floating point comparison
From: Emil Dotchevski (emil_at_[hidden])
Date: 2015-04-28 00:42:48
On Mon, Apr 27, 2015 at 7:23 PM, Gennadiy Rozental <rogeeff_at_[hidden]>
wrote:
> Raffi Enficiaud <raffi.enficiaud <at> mines-paris.org> writes:
>
> > The corresponding equivalent code should be
> >
> > bool check( float a, float b, float tolerance )
> > {
> > using namespace boost::math::fpc;
> > close_at_tolerance obj(tolerance);
>
> close_at_tolerance<float> obj(tolerance);
>
> > return obj(a,b);
> > }
>
>
With
#include <boost/test/tools/floating_point_comparison.hpp>
bool check( float a, float b, float tolerance )
{
using namespace boost::math::fpc;
close_at_tolerance<float> obj(tolerance);
obj(a,b);
}
I get "type 'float' unexpected".
Am I including the correct header? Can I please get an exact working
function? :)
Thanks!
Emil
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk