Centralized numeric tolerance policy and comparison utilities.
More...
#include <cmath>
#include <limits>
Go to the source code of this file.
|
| bool | NumericConstants::NearlyEqual (double a, double b, double tolerance=PRECISION) |
| |
| bool | NumericConstants::NearlyZero (double value, double tolerance=PRECISION) |
| |
| bool | NumericConstants::GreaterThan (double a, double b, double tolerance=PRECISION) |
| |
| bool | NumericConstants::LessThan (double a, double b, double tolerance=PRECISION) |
| |
| bool | NumericConstants::GreaterThanOrEqual (double a, double b, double tolerance=PRECISION) |
| |
| bool | NumericConstants::LessThanOrEqual (double a, double b, double tolerance=PRECISION) |
| |
Centralized numeric tolerance policy and comparison utilities.
This file provides consistent tolerance values and helper functions for floating-point comparisons throughout the codebase.
◆ GreaterThan()
| bool NumericConstants::GreaterThan |
( |
double | a, |
|
|
double | b, |
|
|
double | tolerance = PRECISION ) |
|
inline |
Check if value a is greater than value b with tolerance.
- Parameters
-
| a | First value |
| b | Second value |
| tolerance | Tolerance threshold for comparison (default: PRECISION) |
- Returns
- true if a > b + tolerance, false otherwise
◆ GreaterThanOrEqual()
| bool NumericConstants::GreaterThanOrEqual |
( |
double | a, |
|
|
double | b, |
|
|
double | tolerance = PRECISION ) |
|
inline |
Check if value a is greater than or equal to value b with tolerance.
- Parameters
-
| a | First value |
| b | Second value |
| tolerance | Tolerance threshold for comparison (default: PRECISION) |
- Returns
- true if a >= b - tolerance, false otherwise
◆ LessThan()
| bool NumericConstants::LessThan |
( |
double | a, |
|
|
double | b, |
|
|
double | tolerance = PRECISION ) |
|
inline |
Check if value a is less than value b with tolerance.
- Parameters
-
| a | First value |
| b | Second value |
| tolerance | Tolerance threshold for comparison (default: PRECISION) |
- Returns
- true if a < b - tolerance, false otherwise
◆ LessThanOrEqual()
| bool NumericConstants::LessThanOrEqual |
( |
double | a, |
|
|
double | b, |
|
|
double | tolerance = PRECISION ) |
|
inline |
Check if value a is less than or equal to value b with tolerance.
- Parameters
-
| a | First value |
| b | Second value |
| tolerance | Tolerance threshold for comparison (default: PRECISION) |
- Returns
- true if a <= b + tolerance, false otherwise
◆ NearlyEqual()
| bool NumericConstants::NearlyEqual |
( |
double | a, |
|
|
double | b, |
|
|
double | tolerance = PRECISION ) |
|
inline |
Compare two floating-point values for near-equality.
- Parameters
-
| a | First value to compare |
| b | Second value to compare |
| tolerance | Tolerance threshold for comparison (default: PRECISION) |
- Returns
- true if |a - b| <= tolerance, false otherwise
◆ NearlyZero()
| bool NumericConstants::NearlyZero |
( |
double | value, |
|
|
double | tolerance = PRECISION ) |
|
inline |
Check if a value is nearly zero.
- Parameters
-
| value | Value to check |
| tolerance | Tolerance threshold for comparison (default: PRECISION) |
- Returns
- true if |value| <= tolerance, false otherwise