Mono Class Library: System.SByte Overview | Members

System.SByte.CompareTo Method

Returns the sort order of the current instance compared to the specified object.

public int CompareTo (object obj)

Parameters

obj
The object to compare to the current instance.

Returns

The return value is a negative number, zero, or a positive number reflecting the sort order of the current instance as compared to obj. For non-zero return values, the exact value returned by this method is unspecified. The following table defines the return value:

Return ValueDescription
A negative numberCurrent instance < obj.
ZeroCurrent instance == obj.
A positive numberCurrent instance > obj, or obj is a null reference.

Exceptions

TypeReason
ArgumentExceptionobj is not a sbyte and is not a null reference.

Remarks

Note: This method is implemented to support the IComparable interface.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0