EsbDecimals - a Free Subset of ESBPCS for .NET

CompareOps.SameValue Method (Double, Double)

Returns True if the Values are within a "small" value of each other. DoublePrecisionDef defines the precision.

If you want more control over the comparison then use CompareValue

[Visual Basic]
Overloads Public Shared Function SameValue( _
   ByVal x As Double, _
   ByVal y As Double _
) As Boolean
[C#]
public static bool SameValue(
   double x,
   double y
);

Parameters

x
First Value to compare.
y
Second Value to compare.

Return Value

true if values are within precision of each other.

Remarks

There is an overloaded version that allows you to specifiy the precision of the comparison.

See Also

CompareOps Class | Esb.Math Namespace | CompareOps.SameValue Overload List