NullableTypes Class Library

NullableDouble.CompareTo Method 

Compares this NullableDouble structure to a specified object and returns an indication of their relative values.

[Visual Basic]
NotOverridable Public Function CompareTo( _
   ByVal value As Object _
) As Integer Implements _
   IComparable.CompareTo
[C#]
public int CompareTo(
   object value
);

Parameters

value
An object to compare, or a null reference (Nothing in Visual Basic).

Return Value

A signed number indicating the relative values of the instance and value.

ValueDescription
A negative integer This instance is less than value

-or-

This instance is not a number (NaN) and value is a number.
Zero This instance is equal to value

-or-

This instance and value are both NaN, PositiveInfinity or NegativeInfinity.
A positive integer This instance is greater than value

-or-

this instance is a number and value is not a number (NaN)

-or-

value is a null reference (Nothing in Visual Basic) or Null.

Implements

IComparable.CompareTo

Remarks

Any instance of NullableDouble , regardless of its value, is considered greater than a null reference (Nothing in Visual Basic) and Null.

This behavior follow CLR specifications while Operator== follows different IEEE 754 specs.

Exceptions

Exception TypeCondition
ArgumentException The value is neither null or of type NullableDouble.

See Also

NullableDouble Class | NullableTypes Namespace