System.SByte.CompareTo Method

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

Syntax

public int CompareTo (object obj)

Parameters

obj
An object to compare, or null.

Returns

A signed number indicating the relative values of this instance and obj.

Less than zero

This instance is less than obj.

Zero

This instance is equal to obj.

Greater than zero

This instance is greater than obj.

-or-

obj is null.

Exceptions

TypeReason
ArgumentException obj is not a sbyte and is not a null reference.

Remarks

Any instance of sbyte, regardless of its value, is considered greater than null.

The obj parameter must be null or an instance of sbyte; otherwise, an exception is thrown.

Requirements

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