C# BigInteger Equality(BigInteger, UInt64)
Description
BigInteger Equality(BigInteger, UInt64)
Returns a
value that indicates whether a BigInteger value and an unsigned long integer
value are equal.
Syntax
BigInteger.Equality(BigInteger, UInt64)
has the following syntax.
public static bool operator ==(
BigInteger left,
ulong right
)
Parameters
BigInteger.Equality(BigInteger, UInt64)
has the following parameters.
left
- The first value to compare.right
- The second value to compare.
Returns
BigInteger.Equality(BigInteger, UInt64)
method returns true if the left and right parameters have the same value; otherwise, false.
Example
/*from w ww .j av a2s.c o m*/
using System;
using System.IO;
using System.Numerics;
public class Example
{
public static void Main()
{
BigInteger bigNumber = BigInteger.Pow(2, 63) - BigInteger.One;
ulong uNumber = Int64.MaxValue & 0x7FFFFFFFFFFFFFFF;
Console.WriteLine(bigNumber == uNumber);
}
}
The code above generates the following result.