28 static double BeNextafter (
double x,
double y) {
return _nextafter(x,y);}
29 static int BeIsnan (
double v) {
return _isnan(v);}
30 static int BeFinite (
double v) {
return _finite(v);}
40 return BeNextafter (v, DBL_MAX) - v;
49 double uv = std::max<double> (fabs(sv1), fabs(sv2));
50 return (uv < 1.0)? DBL_EPSILON: NextafterDelta(uv);
57 static int Compare (
double sv1,
double sv2)
59 if (fabs (sv2 - sv1) < ComputeComparisonTolerance (sv1, sv2))
61 return sv1 < sv2? -1: 1;
static int BeIsnan(double v)
Definition: BeNumerical.h:29
#define BENTLEYDLL_EXPORT
Definition: Bentley.h:249
Numerical utilities.
Definition: BeNumerical.h:26
uint32_t UInt32
Definition: Bentley.r.h:128
#define BEGIN_BENTLEY_NAMESPACE
Definition: Bentley.r.h:24
static int Compare(double sv1, double sv2)
Compare two values to the closest tolerance possible.
Definition: BeNumerical.h:57
static double NextafterDelta(double sv)
Get the smallest value that, when added to fabs(sv), yields a number that is not equal to fabs(sv)...
Definition: BeNumerical.h:37
static double ComputeComparisonTolerance(double sv1, double sv2)
Compute the tolerance that should be used to check if these two numbers are not equal.
Definition: BeNumerical.h:47
Defines typedefs and constants that can be used across other namespaces. All Bentley-authored C++ sou...
static double BeNextafter(double x, double y)
Definition: BeNumerical.h:28
#define END_BENTLEY_NAMESPACE
Definition: Bentley.r.h:25
static int BeFinite(double v)
Definition: BeNumerical.h:30