id summary reporter owner description type status milestone component version severity resolution keywords cc 725 floating point comparison algorithm nobody Gennadiy Rozental "{{{ 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 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::operator() function: bool operator()( FPT left, FPT right ) const { if (left == 0.0 || right == 0.0) { return (p_fraction_tolerance.get() > tt_detail::fpt_abs(left-right)); } // ... } My email address is ""tom.vanroey@vito.be"". }}}" Bugs closed test None Invalid