C# BigInteger Explicit(Decimal to BigInteger)

Description

BigInteger Explicit(Decimal to BigInteger) Defines an explicit conversion of a Decimal object to a BigInteger value.

Syntax

BigInteger.Explicit(Decimal to BigInteger) has the following syntax.


public static explicit operator BigInteger (
  decimal value
)

Parameters

BigInteger.Explicit(Decimal to BigInteger) has the following parameters.

  • value - The value to convert to a BigInteger.

Returns

BigInteger.Explicit(Decimal to BigInteger) method returns An object that contains the value of the value parameter.

Example


using System;/*  w w  w .j a v a  2s  . c  om*/
using System.IO;
using System.Numerics;

public class Example
{
   public static void Main()
   {
        decimal[] decimals = { Decimal.MinValue, -15632.991m, 9029321.12m, 
                               Decimal.MaxValue };
        BigInteger number; 
        
        Console.WriteLine("{0,35} {1,35}\n", "Decimal", "BigInteger");
        
        foreach (decimal value in decimals)
        {
           number = (BigInteger) value;
           Console.WriteLine("{0,35} {1,35}", value, number);
        }
    
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Numerics »




BigInteger
Complex