C# BigInteger BigInteger(Double)
Description
BigInteger BigInteger(Double)
Initializes a new instance
of the BigInteger structure using a double-precision floating-point value.
Syntax
BigInteger.BigInteger(Double)
has the following syntax.
public BigInteger(
double value
)
Parameters
BigInteger.BigInteger(Double)
has the following parameters.
value
- A double-precision floating-point value.
Example
//from w ww . j a v a 2s . c o m
using System;
using System.Numerics;
public class Example
{
public static void Main()
{
double doubleValue = -6e20;
BigInteger bigIntValue = new BigInteger(doubleValue);
Console.WriteLine("Original Double value: {0:N0}", doubleValue);
Console.WriteLine("Original BigInteger value: {0:N0}", bigIntValue);
}
}
The code above generates the following result.