![cpp](https://habrastorage.org/r/w120/webt/5a/80/ee/5a80eee835721314512847.png)
C++
1
Вклад в тег
#include <cmath> /* for std::abs(double) */
inline bool isEqual(double x, double y)
{
const double epsilon = /* some small number such as 1e-5 */;
return std::abs(x - y) <= epsilon * std::abs(x);
// see Knuth section 4.2.2 pages 217-218
}