C# BigInteger Equals(UInt64)

Description

BigInteger Equals(UInt64) Returns a value that indicates whether the current instance and an unsigned 64-bit integer have the same value.

Syntax

BigInteger.Equals(UInt64) has the following syntax.


[CLSCompliantAttribute(false)]
public bool Equals(
  ulong other
)

Parameters

BigInteger.Equals(UInt64) has the following parameters.

  • other - The unsigned 64-bit integer to compare.

Returns

BigInteger.Equals(UInt64) method returns true if the current instance and the unsigned 64-bit integer have the same value; otherwise, false.

Example


using System;//  w w  w . j  ava  2s.  c om
using System.IO;
using System.Numerics;

public class Example
{
   public static void Main()
   {
        const long LIGHT_YEAR = 5878625373183;
        
        BigInteger altairDistance = 17 * LIGHT_YEAR;
        BigInteger epsilonIndiDistance = 12 * LIGHT_YEAR;
        BigInteger ursaeMajoris47Distance = 46 * LIGHT_YEAR;
        long tauCetiDistance = 12 * LIGHT_YEAR;
        ulong procyon2Distance = 12 * LIGHT_YEAR;
        object wolf424ABDistance = 14 * LIGHT_YEAR;
        
        Console.WriteLine("   Procyon 2: {0}", 
                          epsilonIndiDistance.Equals(procyon2Distance));
        

    
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Numerics »




BigInteger
Complex