#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 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() |
Detailed Description
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"
- Examples
- LA_example_00001.cpp.
Definition at line 160 of file commonUtils.hpp.
Member Function Documentation
◆ operator()()
|
inline |
Compares the specified double precision floating point numbers and returns true if the numbers match.
- Parameters
-
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
- Returns
- Returns true if the numbers match, false otherwise.
Definition at line 174 of file commonUtils.hpp.
The documentation for this struct was generated from the following file:
- src/common/commonUtils.hpp
