| NumericCompare Method (Single, Single, Single) |
Compares two float values (regarding a specific tolerance).
Namespace: DigitalRune.MathematicsAssembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax public static int Compare(
float value1,
float value2,
float epsilon
)
Public Shared Function Compare (
value1 As Single,
value2 As Single,
epsilon As Single
) As Integer
public:
static int Compare(
float value1,
float value2,
float epsilon
)
static member Compare :
value1 : float32 *
value2 : float32 *
epsilon : float32 -> int
Parameters
- value1
- Type: SystemSingle
The first value. - value2
- Type: SystemSingle
The second value. - epsilon
- Type: SystemSingle
The tolerance value for equality.
Return Value
Type:
Int32
-1 if
value1 is less than
value2, +1 if
value1 is greater than
value2, and 0 if the values are
equal (within the tolerance
epsilon).
Exceptions Remarks Important: When at least one of the parameters is a special floating-point
value (such as
NaN,
PositiveInfinity, or
NegativeInfinity), the result is undefined. Such cases should be
handled explicitly by the calling application.
See Also