C# BigInteger Equality(UInt64, BigInteger)

Description

BigInteger Equality(UInt64, BigInteger) Returns a value that indicates whether an unsigned long integer value and a BigInteger value are equal.

Syntax

BigInteger.Equality(UInt64, BigInteger) has the following syntax.


public static bool operator ==(
  ulong left,
  BigInteger right
)

Parameters

BigInteger.Equality(UInt64, BigInteger) has the following parameters.

  • left - The first value to compare.
  • right - The second value to compare.

Returns

BigInteger.Equality(UInt64, BigInteger) method returns true if the left and right parameters have the same value; otherwise, false.

Example


using System;/* ww w . j  a  va  2  s .  c o  m*/
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(uNumber == bigNumber);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Numerics »




BigInteger
Complex