Method LessThanOrClose
LessThanOrClose(double, double)
Determines whether the first double-precision floating-point value is less than or approximately equal to the second value.
public static bool LessThanOrClose(double value1, double value2)
Parameters
value1doubleThe first double-precision floating-point value to compare.
value2doubleThe second double-precision floating-point value to compare.
Returns
- bool
true if
value1is less thanvalue2, or if the two values are approximately equal; otherwise, false.
Remarks
The method uses a predefined tolerance to determine whether the two values are approximately equal. This is useful for comparisons where floating-point precision errors might otherwise lead to unexpected results.
LessThanOrClose(float, float)
Determines whether the first floating-point value is less than or approximately equal to the second value.
public static bool LessThanOrClose(float value1, float value2)
Parameters
value1floatThe first floating-point value to compare.
value2floatThe second floating-point value to compare.
Returns
- bool
true if
value1is less thanvalue2, or if the two values are approximately equal; otherwise, false.
Remarks
The method uses a predefined tolerance to determine whether the two values are approximately equal. This is useful for comparisons where floating-point precision errors might otherwise lead to unexpected results.