Click or drag to resize

ExtensionsCompareTo Method

Compares the two values and returns an integer that indicates whether the first value is less than, equal to, or greater than the second value.

Namespace:  Enkoni.Framework
Assembly:  Enkoni.Framework (in Enkoni.Framework.dll) Version: 1.3.0.1
Syntax
public static int CompareTo(
	this double source,
	double value,
	double comparisonFactor,
	DoubleCompareOption compareOption
)

Parameters

source
Type: SystemDouble
The first value to compare.
value
Type: SystemDouble
The second value to compare.
comparisonFactor
Type: SystemDouble
The factor that must be taken into account. If compareOption is set to Margin, the comparison factor will be treated as an absolute margin. If compareOption is set to SignificantDigits the comparison factor will be treated as the number of digits that must be examined will comparing. Note that the comparison factor in that case will be truncated to an integer.
compareOption
Type: Enkoni.FrameworkDoubleCompareOption
Defines the method that must be used to compare the double values.

Return Value

Type: Int32
A signed number indicating the relative values of the two numbers.
Return Value Description
Less than zero: source is less than value -or- source is not a number (NaN) and value is a number.
Zero: source is equal to value -or- Both source and value are not a number (NaN), PositiveInfinity, or NegativeInfinity.
Greater than zero: source is greater than value -or- source is a number and value is not a number (NaN).

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Double. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also