BigInteger.IComparable.CompareTo Method

.NET Framework (current version)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Namespace:  System.Numerics
Assembly:  System.Runtime.Numerics (in System.Runtime.Numerics.dll)

int IComparable.CompareTo(
	Object obj
)

Parameters

obj
Type: System.Object

An object to compare with this instance, or null.

Return Value

Type: System.Int32
A signed integer that indicates the relative order of this instance and obj.

Return value

Description

Less than zero

This instance precedes obj in the sort order.

Zero

This instance occurs in the same position as obj in the sort order.

Greater than zero

This instance follows obj in the sort order.

-or-

value is null.

Implements

IComparable.CompareTo(Object)

ExceptionCondition
ArgumentException

obj is not a BigInteger.

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

.NET Framework

Supported in: 4.6

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

Portable Class Library

Supported in: Portable Class Library
Show: