BigInteger.GreaterThan 运算符
定义
返回一个值,该值指示指定的值是否大于另一个指定的值。Returns a value that indicates whether a specified value is greater than another specified value.
重载
GreaterThan(Int64, BigInteger) |
返回一个值,该值指示 64 位带符号整数是否大于 BigInteger 值。Returns a value that indicates whether a 64-bit signed integer is greater than a BigInteger value. |
GreaterThan(BigInteger, Int64) |
返回一个值,该值指示 BigInteger 是否大于 64 位带符号整数值。Returns a value that indicates whether a BigInteger is greater than a 64-bit signed integer value. |
GreaterThan(BigInteger, BigInteger) |
返回一个值,该值指示 BigInteger 值是否大于另一个 BigInteger 值。Returns a value that indicates whether a BigInteger value is greater than another BigInteger value. |
GreaterThan(BigInteger, UInt64) |
返回一个值,该值指示 BigInteger 值是否大于 64 位无符号整数。Returns a value that indicates whether a BigInteger value is greater than a 64-bit unsigned integer. |
GreaterThan(UInt64, BigInteger) |
返回一个值,该值指示 BigInteger 值是否大于 64 位无符号整数。Returns a value that indicates whether a BigInteger value is greater than a 64-bit unsigned integer. |
GreaterThan(Int64, BigInteger)
返回一个值,该值指示 64 位带符号整数是否大于 BigInteger 值。Returns a value that indicates whether a 64-bit signed integer is greater than a BigInteger value.
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
要比较的第一个值。The first value to compare.
- right
- BigInteger
要比较的第二个值。The second value to compare.
返回
如果 true
大于 left
,则为 right
;否则为 false
。true
if left
is greater than right
; otherwise, false
.
注解
GreaterThan方法为值定义大于运算符的运算 BigInteger 。The GreaterThan method defines the operation of the greater than operator for BigInteger values. 它可以实现如下所示的代码:It enables code such as the following:
BigInteger bigNumber = BigInteger.Pow(Int32.MaxValue, 4);
long number = Int64.MaxValue;
if (number > bigNumber) {
// Do something;
}
Dim bigNumber As BigInteger = BigInteger.Pow(Int32.MaxValue, 4)
Dim number As Long = Int64.MaxValue
If number > bigNumber Then
' Do something
End If
不支持自定义运算符的语言可以改为调用 BigInteger.CompareTo(Int64) 实例方法。Languages that do not support custom operators can call the BigInteger.CompareTo(Int64) instance method instead. 某些语言还可以直接调用 GreaterThan(Int64, BigInteger) 方法,如下例所示。Some languages can also call the GreaterThan(Int64, BigInteger) method directly, as the following example shows.
Dim bigNumber As BigInteger = BigInteger.Pow(Int32.MaxValue, 4)
Dim number As Long = Int64.MaxValue
If BigInteger.op_GreaterThan(number,bigNumber) Then
' Do something
End If
如果 left
为、、、、 Byte Int16 Int32 SByte UInt16 或值,则在 UInt32 执行操作时,它将隐式转换为 Int64 值。If left
is a Byte, Int16, Int32, SByte, UInt16, or UInt32 value, it is implicitly converted to an Int64 value when the operation is performed.
此运算符的等效方法为 BigInteger.CompareTo(Int64) 。The equivalent method for this operator is BigInteger.CompareTo(Int64).
另请参阅
适用于
GreaterThan(BigInteger, Int64)
返回一个值,该值指示 BigInteger 是否大于 64 位带符号整数值。Returns a value that indicates whether a BigInteger is greater than a 64-bit signed integer value.
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
要比较的第一个值。The first value to compare.
- right
- Int64
要比较的第二个值。The second value to compare.
返回
如果 true
大于 left
,则为 right
;否则为 false
。true
if left
is greater than right
; otherwise, false
.
注解
GreaterThan方法为值定义大于运算符的运算 BigInteger 。The GreaterThan method defines the operation of the greater than operator for BigInteger values. 它可以实现如下所示的代码:It enables code such as the following:
BigInteger bigNumber = BigInteger.Pow(Int32.MaxValue, 4);
long number = Int64.MaxValue;
if (bigNumber > number) {
// Do something;
}
Dim bigNumber As BigInteger = BigInteger.Pow(Int32.MaxValue, 4)
Dim number As Long = Int64.MaxValue
If bigNumber > Number Then
' Do something
End If
不支持自定义运算符的语言可以改为调用 BigInteger.CompareTo(Int64) 方法。Languages that do not support custom operators can call the BigInteger.CompareTo(Int64) method instead. 某些语言还可以直接调用 GreaterThan(BigInteger, Int64) 方法,如下例所示。Some languages can also call the GreaterThan(BigInteger, Int64) method directly, as the following example shows.
Dim bigNumber As BigInteger = BigInteger.Pow(Int32.MaxValue, 4)
Dim number As Long = Int64.MaxValue
If BigInteger.op_GreaterThan(bigNumber,number) Then
' Do something
End If
如果 right
为、、、、 Byte Int16 Int32 SByte UInt16 或值,则在 UInt32 执行操作时,它将隐式转换为 Int64 值。If right
is a Byte, Int16, Int32, SByte, UInt16, or UInt32 value, it is implicitly converted to an Int64 value when the operation is performed.
此运算符的等效方法为 BigInteger.CompareTo(Int64) 。The equivalent method for this operator is BigInteger.CompareTo(Int64).
另请参阅
适用于
GreaterThan(BigInteger, BigInteger)
返回一个值,该值指示 BigInteger 值是否大于另一个 BigInteger 值。Returns a value that indicates whether a BigInteger value is greater than another BigInteger value.
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
要比较的第一个值。The first value to compare.
- right
- BigInteger
要比较的第二个值。The second value to compare.
返回
如果 true
大于 left
,则为 right
;否则为 false
。true
if left
is greater than right
; otherwise, false
.
注解
GreaterThan方法为值定义大于运算符的运算 BigInteger 。The GreaterThan method defines the operation of the greater 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 True
Console.WriteLine(number1 > number3); // Displays False
Dim number1 As BigInteger = 945834723
Dim number2 As BigInteger = 345145625
Dim number3 As BigInteger = 945834724
Console.WriteLine(number1 > number2) ' Displays True
Console.WriteLine(number1 > number3) ' Displays False
不支持自定义运算符的语言可以改为调用 BigInteger.Compare(BigInteger, BigInteger) 方法。Languages that do not support custom operators can call the BigInteger.Compare(BigInteger, BigInteger) method instead. 它们还可以直接调用 GreaterThan(BigInteger, BigInteger) 方法,如下例所示。They can also call the GreaterThan(BigInteger, BigInteger) method directly, as the following example shows.
Dim numberA As BigInteger = 945834723
Dim numberB As BigInteger = 345145625
Dim numberC As BigInteger = 945834724
Console.WriteLine(BigInteger.op_GreaterThan(numberA, numberB)) ' Displays True
Console.WriteLine(BigInteger.op_GreaterThan(numberA, numberC)) ' Displays False
此运算符的等效方法为 BigInteger.CompareTo(BigInteger) 。The equivalent method for this operator is BigInteger.CompareTo(BigInteger).
另请参阅
适用于
GreaterThan(BigInteger, UInt64)
重要
此 API 不符合 CLS。
返回一个值,该值指示 BigInteger 值是否大于 64 位无符号整数。Returns a value that indicates whether a BigInteger value is greater than a 64-bit unsigned integer.
public:
static bool operator >(System::Numerics::BigInteger left, System::UInt64 right);
public static bool operator > (System.Numerics.BigInteger left, ulong right);
[System.CLSCompliant(false)]
public static bool operator > (System.Numerics.BigInteger left, ulong right);
static member ( > ) : System.Numerics.BigInteger * uint64 -> bool
[<System.CLSCompliant(false)>]
static member ( > ) : System.Numerics.BigInteger * uint64 -> bool
Public Shared Operator > (left As BigInteger, right As ULong) As Boolean
参数
- left
- BigInteger
要比较的第一个值。The first value to compare.
- right
- UInt64
要比较的第二个值。The second value to compare.
返回
如果 true
大于 left
,则为 right
;否则为 false
。true
if left
is greater than right
; otherwise, false
.
- 属性
注解
GreaterThan方法为值定义大于运算符的运算 BigInteger 。The GreaterThan method defines the operation of the greater than operator for BigInteger values. 它可以实现如下所示的代码:It enables code such as the following:
BigInteger bigNumber = BigInteger.Pow(Int32.MaxValue, 2);
ulong number = UInt64.MaxValue;
if (bigNumber > number) {
// Do something
}
Dim bigNumber As BigInteger = BigInteger.Pow(Int32.MaxValue, 2)
Dim number As ULong = UInt64.MaxValue
If bigNumber > number Then
' Do something
End If
不支持自定义运算符的语言可以改为调用 BigInteger.CompareTo(UInt64) 方法。Languages that do not support custom operators can call the BigInteger.CompareTo(UInt64) method instead. 某些语言还可以直接调用 GreaterThan(BigInteger, UInt64) 方法,如下例所示。Some languages can also call the GreaterThan(BigInteger, UInt64) method directly, as the following example shows.
Dim bigNumber As BigInteger = BigInteger.Pow(Int32.MaxValue, 2)
Dim number As ULong = UInt64.MaxValue
If BigInteger.op_GreaterThan(bigNumber, number) Then
' Do something
End If
适用于
GreaterThan(UInt64, BigInteger)
重要
此 API 不符合 CLS。
返回一个值,该值指示 BigInteger 值是否大于 64 位无符号整数。Returns a value that indicates whether a BigInteger value is greater than a 64-bit unsigned integer.
public:
static bool operator >(System::UInt64 left, System::Numerics::BigInteger right);
public static bool operator > (ulong left, System.Numerics.BigInteger right);
[System.CLSCompliant(false)]
public static bool operator > (ulong left, System.Numerics.BigInteger right);
static member ( > ) : uint64 * System.Numerics.BigInteger -> bool
[<System.CLSCompliant(false)>]
static member ( > ) : uint64 * System.Numerics.BigInteger -> bool
Public Shared Operator > (left As ULong, right As BigInteger) As Boolean
参数
- left
- UInt64
要比较的第一个值。The first value to compare.
- right
- BigInteger
要比较的第二个值。The second value to compare.
返回
如果 true
大于 left
,则为 right
;否则为 false
。true
if left
is greater than right
; otherwise, false
.
- 属性
注解
GreaterThan方法为值定义大于运算符的运算 BigInteger 。The GreaterThan method defines the operation of the greater than operator for BigInteger values. 它可以实现如下所示的代码:It enables code such as the following:
BigInteger bigNumber = BigInteger.Pow(Int32.MaxValue, 2);
ulong number = UInt64.MaxValue;
if (number > bigNumber) {
// Do something
}
Dim bigNumber As BigInteger = BigInteger.Pow(Int32.MaxValue, 2)
Dim number As ULong = UInt64.MaxValue
If number > bigNumber Then
' Do something
End If
不支持自定义运算符的语言可以改为调用 BigInteger.CompareTo(UInt64) 方法。Languages that do not support custom operators can call the BigInteger.CompareTo(UInt64) method instead. 某些语言还可以直接调用 GreaterThan(UInt64, BigInteger) 方法,如下例所示。Some languages can also call the GreaterThan(UInt64, BigInteger) method directly, as the following example shows.
Dim bigNumber As BigInteger = BigInteger.Pow(Int32.MaxValue, 2)
Dim number As ULong = UInt64.MaxValue
If BigInteger.op_GreaterThan(number, bigNumber) Then
' Do something
End If