Compares this instance to the specified object, which must be either an SByte type or a null object reference. The SByte type is not CLS compliant. The CLS-compliant alternative is Byte.
[C#] public virtual int CompareTo( object obj ); [C++] public: virtual int CompareTo( Object* obj ); [JScript] public function CompareTo( obj : Object ) : int;
[Visual Basic] The SByte type cannot be used in Visual Basic.
Value | Condition |
---|---|
A negative integer | If this instance is less than object. |
Zero | If this instance and object have the same value. |
A positive integer | If this instance is greater than object. |
A positive integer | If object is null. This is a special case. |
Exception Type | Condition |
---|---|
ArgumentException | If the object is a non-null reference and is not of type SByte. |
When comparing two SByte values, the canonical ordering is used. As a special case, an instance, regardless of its value, is considered to be greater than a null object reference.
The parameter object must be either an SByte type or a null reference.