#include <limits> #include <cmath> bool compareDoubles(double lhs, double rhs) { return std::abs(lhs - rhs) < std::numeric_limits<double>::epsilon(); }