Edit

Share via


Int64.IComparable.CompareTo(Object) Method

Definition

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

C#
int IComparable.CompareTo(object value);

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 value is null.

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

Product Versions
.NET Core 1.0, Core 1.1
.NET Standard 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6
UWP 10.0