C# BigInteger Equals(Int64)

Description

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

Syntax

BigInteger.Equals(Int64) has the following syntax.


public bool Equals(
  long other
)

Parameters

BigInteger.Equals(Int64) has the following parameters.

  • other - The signed 64-bit integer value to compare.

Returns

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

Example


using System;/*ww w.  j  a  v a  2 s  .  c  o  m*/
using System.IO;
using System.Numerics;

public class Example
{
   public static void Main()
   {

        BigInteger bigIntValue; 
        
        long longValue = -123822229012;
        bigIntValue = new BigInteger(longValue);
        Console.WriteLine(bigIntValue.Equals(longValue));
    
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Numerics »




BigInteger
Complex