Int64.IComparable.CompareTo(Object) Method

Definition

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

 virtual int System.IComparable.CompareTo(System::Object ^ value) = IComparable::CompareTo;
int IComparable.CompareTo (object value);
Function CompareTo (value As Object) As Integer Implements IComparable.CompareTo

Parameters

value
Object

An object to compare, or null.

Returns

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

Return ValueDescription
Less than zeroThis instance is less than value.
ZeroThis instance is equal to value.
Greater than zeroThis instance is greater than value.

            -or-

            <code data-dev-comment-type="paramref">value</code> is <code data-dev-comment-type="langword">null</code>.</td></tr></tbody></table>

Implements

Exceptions

value is not an Int64.

Remarks

This member is an explicit interface member implementation. It can be used only when the Int64 instance is cast to an IConvertible interface.

An Int64, regardless of its value, is considered greater than a null reference.

Applies to