# BigInteger.LessThan 运算符

## 重载

 LessThan(Int64, BigInteger) 返回一个值，该值指示 64 位带符号整数是否小于 BigInteger 值。Returns a value that indicates whether a 64-bit signed integer is less than a BigInteger value. LessThan(BigInteger, Int64) 返回一个值，该值指示 BigInteger 值是否小于 64 位带符号整数。Returns a value that indicates whether a BigInteger value is less than a 64-bit signed integer. LessThan(BigInteger, BigInteger) 返回一个值，该值指示 BigInteger 值是否小于另一个 BigInteger 值。Returns a value that indicates whether a BigInteger value is less than another BigInteger value. LessThan(BigInteger, UInt64) 返回一个值，该值指示 BigInteger 值是否小于 64 位无符号整数。Returns a value that indicates whether a BigInteger value is less than a 64-bit unsigned integer. LessThan(UInt64, BigInteger) 返回一个值，该值指示 64 位无符号整数是否小于 BigInteger 值。Returns a value that indicates whether a 64-bit unsigned integer is less than a BigInteger value.

## LessThan(Int64, BigInteger)

``````public:
static bool operator <(long left, System::Numerics::BigInteger right);``````
``public static bool operator < (long left, System.Numerics.BigInteger right);``
``static member ( < ) : int64 * System.Numerics.BigInteger -> bool``
``Public Shared Operator < (left As Long, right As BigInteger) As Boolean``

left
Int64

right
BigInteger

### 注解

LessThan 方法定义 BigInteger 值的小于运算符的运算。The LessThan method defines the operation of the less than operator for BigInteger values. 它可以实现如下所示的代码：It enables code such as the following:

``````BigInteger number = BigInteger.Parse("9801324316220166912");
if (Int64.MaxValue < number)
{
// Do something.
}
else
{
// Do something else.
}
``````
``````Dim number As BigInteger = BigInteger.Parse("9801324316220166912")
If Int64.MaxValue < number Then
' Do something.
Else
' Do something else.
End If
``````

``````Dim number As BigInteger = BigInteger.Parse("9801324316220166912")
If BigInteger.op_LessThan(Int64.MaxValue, number) Then
' Do something.
Else
' Do something else.
End If
``````

## LessThan(BigInteger, Int64)

``````public:
static bool operator <(System::Numerics::BigInteger left, long right);``````
``public static bool operator < (System.Numerics.BigInteger left, long right);``
``static member ( < ) : System.Numerics.BigInteger * int64 -> bool``
``Public Shared Operator < (left As BigInteger, right As Long) As Boolean``

left
BigInteger

right
Int64

### 注解

LessThan 方法定义 BigInteger 值的小于运算符的运算。The LessThan method defines the operation of the less than operator for BigInteger values. 它可以实现如下所示的代码：It enables code such as the following:

``````BigInteger number = BigInteger.Parse("9801324316220166912");
if (number < Int64.MaxValue)
{
// Do something.
}
else
{
// Do something else.
}
``````
``````Dim number As BigInteger = BigInteger.Parse("9801324316220166912")
If number < Int64.MaxValue Then
' Do something.
Else
' Do something else.
End If
``````

``````Dim number As BigInteger = BigInteger.Parse("9801324316220166912")
If BigInteger.op_LessThan(number, Int64.MaxValue) Then
' Do something.
Else
' Do something else.
End If
``````

## LessThan(BigInteger, BigInteger)

``````public:
static bool operator <(System::Numerics::BigInteger left, System::Numerics::BigInteger right);``````
``public static bool operator < (System.Numerics.BigInteger left, System.Numerics.BigInteger right);``
``static member ( < ) : System.Numerics.BigInteger * System.Numerics.BigInteger -> bool``
``Public Shared Operator < (left As BigInteger, right As BigInteger) As Boolean``

left
BigInteger

right
BigInteger

### 注解

LessThan 方法定义 BigInteger 值的小于运算符的运算。The LessThan method defines the operation of the less than operator for BigInteger values. 它可以实现如下所示的代码：It enables code such as the following:

``````BigInteger number1 = 945834723;
BigInteger number2 = 345145625;
BigInteger number3 = 945834724;
Console.WriteLine(number1 < number2);              // Displays False
Console.WriteLine(number1 < number3);              // Displays True
``````
``````Dim number1 As BigInteger = 945834723
Dim number2 As BigInteger = 345145625
Dim number3 As BigInteger = 945834724
Console.WriteLine(number1 < number2)                  ' Displays False
Console.WriteLine(number1 < number3)                  ' Displays True
``````

``````Dim numberA As BigInteger = 945834723
Dim numberB As BigInteger = 345145625
Dim numberC As BigInteger = 945834724
Console.WriteLine(BigInteger.op_LessThan(numberA, numberB))    ' Displays False
Console.WriteLine(BigInteger.op_LessThan(numberA, numberC))    ' Displays True
``````

## LessThan(BigInteger, UInt64)

``````public:
static bool operator <(System::Numerics::BigInteger left, System::UInt64 right);``````
``````[System.CLSCompliant(false)]
public static bool operator < (System.Numerics.BigInteger left, ulong right);``````
``public static bool operator < (System.Numerics.BigInteger left, ulong right);``
``static member ( < ) : System.Numerics.BigInteger * uint64 -> bool``
``Public Shared Operator < (left As BigInteger, right As ULong) As Boolean``

left
BigInteger

right
UInt64

### 注解

LessThan 方法定义 BigInteger 值的小于运算符的运算。The LessThan method defines the operation of the less than operator for BigInteger values. 它可以实现如下所示的代码：It enables code such as the following:

``````BigInteger number = BigInteger.Parse("19801324316220166912");
if (number < UInt64.MaxValue)
{
// Do something.
}
else
{
// Do something else.
}
``````
``````Dim number As BigInteger = BigInteger.Parse("19801324316220166912")
If number < UInt64.MaxValue Then
' Do something.
Else
' Do something else.
End If
``````

``````Dim number As BigInteger = BigInteger.Parse("19801324316220166912")
If BigInteger.op_LessThan(number, UInt64.MaxValue) Then
' Do something.
Else
' Do something else.
End If
``````

## LessThan(UInt64, BigInteger)

``````public:
static bool operator <(System::UInt64 left, System::Numerics::BigInteger right);``````
``````[System.CLSCompliant(false)]
public static bool operator < (ulong left, System.Numerics.BigInteger right);``````
``public static bool operator < (ulong left, System.Numerics.BigInteger right);``
``static member ( < ) : uint64 * System.Numerics.BigInteger -> bool``
``Public Shared Operator < (left As ULong, right As BigInteger) As Boolean``

left
UInt64

right
BigInteger

### 注解

LessThan 方法定义 BigInteger 值的小于运算符的运算。The LessThan method defines the operation of the less than operator for BigInteger values. 它可以实现如下所示的代码：It enables code such as the following:

``````BigInteger number = BigInteger.Parse("9801324316220166912");
if (UInt64.MaxValue < number)
{
// Do something.
}
else
{
// Do something else.
}
``````
``````Dim number As BigInteger = BigInteger.Parse("9801324316220166912")
If UInt64.MaxValue < number Then
' Do something.
Else
' Do something else.
End If
``````

``````Dim number As BigInteger = BigInteger.Parse("9801324316220166912")
If BigInteger.op_LessThan(UInt64.MaxValue, number) Then
' Do something.
Else
' Do something else.
End If
``````