Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a value that indicates whether two values are equal.
Equality(UInt64, BigInteger) |
Returns a value that indicates whether an unsigned long integer value and a BigInteger value are equal. |
Equality(BigInteger, BigInteger) |
Returns a value that indicates whether the values of two BigInteger objects are equal. |
Equality(BigInteger, UInt64) |
Returns a value that indicates whether a BigInteger value and an unsigned long integer value are equal. |
Equality(Int64, BigInteger) |
Returns a value that indicates whether a signed long integer value and a BigInteger value are equal. |
Equality(BigInteger, Int64) |
Returns a value that indicates whether a BigInteger value and a signed long integer value are equal. |
Important
This API is not CLS-compliant.
Returns a value that indicates whether an unsigned long integer value and a BigInteger value are equal.
public:
static bool operator ==(System::UInt64 left, System::Numerics::BigInteger right);
[System.CLSCompliant(false)]
public static bool operator ==(ulong left, System.Numerics.BigInteger right);
[<System.CLSCompliant(false)>]
static member ( = ) : uint64 * System.Numerics.BigInteger -> bool
Public Shared Operator == (left As ULong, right As BigInteger) As Boolean
The first value to compare.
The second value to compare.
true
if the left
and right
parameters have the same value; otherwise, false
.
The Equality(UInt64, BigInteger) method defines the equality comparison operation for BigInteger values. It enables code such as the following:
BigInteger bigNumber = BigInteger.Pow(2, 63) - BigInteger.One;
ulong uNumber = Int64.MaxValue & 0x7FFFFFFFFFFFFFFF;
if (uNumber == bigNumber)
{
// Do something...
}
let bigNumber = BigInteger.Pow(2, 63) - BigInteger.One
let uNumber = uint64 Int64.MaxValue &&& 0x7FFFFFFFFFFFFFFFuL
if bigint uNumber = bigNumber then
// Do something...
Dim bigNumber As BigInteger = BigInteger.Pow(2, 63) - BigInteger.One
Dim uNumber As ULong = CULng(Int64.MaxValue And CULng(&h7FFFFFFFFFFFFFFF))
If uNumber = bigNumber Then
' Do something...
End If
Languages that do not support custom operators can call the BigInteger.Equals(UInt64) instance method instead.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Returns a value that indicates whether the values of two BigInteger objects are equal.
public:
static bool operator ==(System::Numerics::BigInteger left, System::Numerics::BigInteger right);
public:
static bool operator ==(System::Numerics::BigInteger left, System::Numerics::BigInteger right) = System::Numerics::IEqualityOperators<System::Numerics::BigInteger, System::Numerics::BigInteger, bool>::op_Equality;
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
The first value to compare.
The second value to compare.
true
if the left
and right
parameters have the same value; otherwise, false
.
The Equality(BigInteger, BigInteger) method defines the operation of the equality operator for BigInteger values. It enables code such as the following:
BigInteger number1 = 945834723;
BigInteger number2 = 345145625;
BigInteger number3 = 945834723;
Console.WriteLine(number1 == number2); // Displays False
Console.WriteLine(number1 == number3); // Displays True
let number1 = 945834723I
let number2 = 345145625I
let number3 = 945834723I
printfn $"{number1 = number2}" // Displays False
printfn $"{number1 = number3}" // Displays True
Dim number1 As BigInteger = 945834723
Dim number2 As BigInteger = 345145625
Dim number3 As BigInteger = 945834723
Console.WriteLine(number1 = number2) ' Displays False
Console.WriteLine(number1 = number3) ' Displays True
Languages that do not support custom operators can call the BigInteger.Equals(BigInteger) instance method instead.
The equivalent method for this operator is BigInteger.Equals(BigInteger).
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Important
This API is not CLS-compliant.
Returns a value that indicates whether a BigInteger value and an unsigned long integer value are equal.
public:
static bool operator ==(System::Numerics::BigInteger left, System::UInt64 right);
[System.CLSCompliant(false)]
public static bool operator ==(System.Numerics.BigInteger left, ulong right);
[<System.CLSCompliant(false)>]
static member ( = ) : System.Numerics.BigInteger * uint64 -> bool
Public Shared Operator == (left As BigInteger, right As ULong) As Boolean
The first value to compare.
The second value to compare.
true
if the left
and right
parameters have the same value; otherwise, false
.
The Equality(BigInteger, UInt64) method defines the equality comparison operation for BigInteger values. It enables code such as the following:
BigInteger bigNumber = BigInteger.Pow(2, 63) - BigInteger.One;
ulong uNumber = Int64.MaxValue & 0x7FFFFFFFFFFFFFFF;
if (bigNumber == uNumber)
{
// Do something...
}
let bigNumber = BigInteger.Pow(2, 63) - BigInteger.One
let uNumber = uint64 Int64.MaxValue &&& 0x7FFFFFFFFFFFFFFFuL
if bigNumber = uNumber then
// Do something...
Dim bigNumber As BigInteger = BigInteger.Pow(2, 63) - BigInteger.One
Dim uNumber As ULong = CULng(Int64.MaxValue And CULng(&h7FFFFFFFFFFFFFFF))
If bigNumber = uNumber Then
' Do something...
End If
Languages that do not support custom operators can call the BigInteger.Equals(UInt64) instance method instead.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Returns a value that indicates whether a signed long integer value and a BigInteger value are equal.
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
The first value to compare.
The second value to compare.
true
if the left
and right
parameters have the same value; otherwise, false
.
The Equality(Int64, BigInteger) method defines the equality comparison operation for BigInteger values. It enables code such as the following:
BigInteger bigNumber = BigInteger.Pow(2, 63);
long number = Int64.MaxValue;
if (number == bigNumber)
{
// Do something...
}
let bigNumber = BigInteger.Pow(2, 63)
let number = Int64.MaxValue
if bigint number = bigNumber then
// Do something...
Dim bigNumber As BigInteger = BigInteger.Pow(2, 63)
Dim number As Long = Int64.MaxValue
If number = bigNumber Then
' Do something...
End If
Languages that do not support custom operators can call the BigInteger.Equals(Int64) instance method instead.
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.
The equivalent method for this operator is BigInteger.Equals(Int64).
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Returns a value that indicates whether a BigInteger value and a signed long integer value are equal.
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
The first value to compare.
The second value to compare.
true
if the left
and right
parameters have the same value; otherwise, false
.
The Equality(BigInteger, Int64) method defines the equality comparison operation for BigInteger values. It enables code such as the following:
BigInteger bigNumber = BigInteger.Pow(2, 63);
long number = Int64.MaxValue;
if (bigNumber == number)
{
// Do something...
}
let bigNumber = BigInteger.Pow(2, 63)
let number = Int64.MaxValue
if bigNumber = number then
// Do something...
Dim bigNumber As BigInteger = BigInteger.Pow(2, 63)
Dim number As Long = Int64.MaxValue
If bigNumber = number Then
' Do something...
End If
Languages that do not support custom operators can call the BigInteger.Equals(Int64) instance method instead.
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.
The equivalent method for this operator is BigInteger.Equals(Int64).
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in