NullableTypes Class Library

NullableSingle.CompareTo Method 

Compares this NullableSingle 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 _
public int CompareTo(
   object 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.

A negative integer This instance is less than value


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


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


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


value is a null reference (Nothing)or Null.




Any instance of NullableSingle , 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.


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

See Also

NullableSingle Class | NullableTypes Namespace