Boost logo

Boost :

From: (noreply_at_[hidden])
Date: 2006-09-06 07:59:20

Bugs item #1553359, was opened at 2006-09-06 04:59
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: test
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Beman Dawes (beman_dawes)
Summary: floating point comparison algorithm

Initial Comment:
The floating point comparison algorithm does not seem
to work if one of the floating points is zero and the
other one is close to zero. Here's the code sample
I've used:

close_at_tolerance<double> checker(0.01);

const double a = 0.0;
const double b = 0.0000001;

bool res = checker(a, b);
if (!res)
  std::cerr << "ERROR" << std::endl;

I think the following check must be added in the
close_at_tolerance<FPT>::operator() function:
bool operator()( FPT left, FPT right ) const
   if (left == 0.0 || right == 0.0)
      return (p_fraction_tolerance.get() >

   // ...

My email address is "tom.vanroey_at_[hidden]".


You can respond by visiting:

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Boost-bugs mailing list

Boost list run by bdawes at, gregod at, cpdaniel at, john at