#include <commonUtils.hpp>
Public Member Functions | |
bool | operator() (double x, double y, double relativeTolerance=DEFAULT_REL_TOL, double absoluteTolerance=DEFAULT_ABS_TOL) const |
Additional Inherited Members | |
Static Protected Attributes inherited from bitpit::utils::DoubleFloatingComparison | |
static constexpr const double | DEFAULT_ABS_TOL = 10 * std::numeric_limits<double>::epsilon() |
static constexpr const double | DEFAULT_REL_TOL = 10 * std::numeric_limits<double>::epsilon() |
Functor to compare two double precision floating point numbers.
See chapter 4.2.2 equation 35 of "The art of computer programming (vol II)" Donald. E. Knuth, 1998, Addison-Wesley Longman, Inc., ISBN 0-201-89684-2, Addison-Wesley Professional; 3rd edition.
Also see: "https://www.boost.org/doc/libs/1_74_0/libs/test/doc/html/boost_test/testing_tools/extended_comparison/floating_point/floating_points_comparison_theory.html"
Definition at line 160 of file commonUtils.hpp.
|
inline |
Compares the specified double precision floating point numbers and returns true if the numbers match.
x | if the first value to compare |
y | if the second value to compare |
relativeTolerance | is the relative tolerance that will be used to perform the comparison |
absoluteTolerance | is the absolute tolerance that will be used to perform the comparison |
Definition at line 174 of file commonUtils.hpp.