|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Helper for float comparison with tolerance. More...
Public Member Functions | |
| FloatToleranceEqual (float tol=0.001f) | |
| Constructs a FloatToleranceEqual comparator with a specified tolerance. | |
| bool | operator() (float a, float b) const |
| Compares two floating-point values for equality within the configured tolerance. | |
Public Attributes | |
| float | tolerance |
Helper for float comparison with tolerance.
Definition at line 1535 of file ah-functional.cc.
|
inline |
Constructs a FloatToleranceEqual comparator with a specified tolerance.
The comparator considers two floating-point values equal when their absolute difference is less than or equal to the configured tolerance.
| tol | Tolerance threshold used for comparisons; defaults to 0.001. |
Definition at line 1545 of file ah-functional.cc.
Compares two floating-point values for equality within the configured tolerance.
| a | First value to compare. |
| b | Second value to compare. |
a and b is less than or equal to tolerance, false otherwise. Definition at line 1553 of file ah-functional.cc.
References tolerance.
| float FloatToleranceEqual::tolerance |
Definition at line 1536 of file ah-functional.cc.
Referenced by operator()().