Click or drag to resize
SingleCompareTo Method (Object)
Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public int CompareTo(
	Object value
)

Parameters

value
Type: SystemObject
An object to compare, or null.

Return Value

Type: Int32
A signed number indicating the relative values of this instance and value.Return Value Description Less than zero 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 not a number (NaN), PositiveInfinity, or NegativeInfinity. Greater than zero This instance is greater than value.-or- This instance is a number and value is not a number (NaN).-or- value is null.
Exceptions
ExceptionCondition
ArgumentExceptionvalue is not a Single.
See Also