1 #ifndef NPSTAT_CLOSEWITHINTOLERANCE_HH_
2 #define NPSTAT_CLOSEWITHINTOLERANCE_HH_
30 "negative tolerance is not allowed");
34 return fabs(a - b)/
std::max(fabs(a), fabs(b)) <= tol;
38 #endif // NPSTAT_CLOSEWITHINTOLERANCE_HH_
bool closeWithinTolerance(const double &a, const double &b, const double &tol)
Exceptions for the npstat namespace.
const T & max(const T &a, const T &b)