Export (0) Print
Expand All

UInt64.CompareTo Method

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

The UInt64 type is not CLS-compliant. The CLS-compliant alternative type is Decimal. Int64 can be used when the original value is less than half of UInt64.MaxValue. For more information about CLS compliance, see What is the Common Language Specification.

[Visual Basic]
Public Overridable Function CompareTo( _
   ByVal value As Object _
) As Integer
[C#]
public virtual int CompareTo(
 object value
);
[C++]
public: virtual int CompareTo(
 Object* value
);
[JScript]
public function CompareTo(
   value : Object
) : int;

Parameters

value
An object to compare, or a null reference (Nothing in Visual Basic).

Return Value

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

Return Value Description
Less than zero This instance is less than value.
Zero This instance is equal to value.
Greater than zero This instance is greater than value.

-or-

value is a null reference (Nothing in Visual Basic).

Exceptions

Exception Type Condition
ArgumentException value is not a UInt64.

Remarks

Any instance of UInt64, regardless of its value, is considered greater than a null reference (Nothing in Visual Basic).

value must be a null reference (Nothing) or an instance of UInt64; otherwise, an exception is thrown.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

UInt64 Structure | UInt64 Members | System Namespace | Equals

Show:
© 2014 Microsoft