BigInteger Explicit Conversion (Double to BigInteger)
Defines an explicit conversion of a Double value to a BigInteger value.
Assembly: System.Numerics (in System.Numerics.dll)
Parameters
- value
- Type: System::Double
The value to convert to a BigInteger.
Return Value
Type: System.Numerics::BigIntegerAn object that contains the value of the value parameter.
| Exception | Condition |
|---|---|
| OverflowException | value is Double::NaN. -or- value is Double::PositiveInfinity. -or- value is Double::NegativeInfinity. |
Any fractional part of the value parameter is truncated before conversion.
The overloads of the Explicit(Decimal to BigInteger) method define the types to which or from which a BigInteger object can be converted. Because the conversion from Double to BigInteger can involve truncating any fractional part of value, language compilers do not perform this conversion automatically. Instead, they perform the conversion only if a casting operator (in C#) or a conversion function (such as CType in Visual Basic) is used. Otherwise, they display a compiler error.
The following example converts the individual elements in an array of Double values to BigInteger objects, and then displays the result of each conversion. Note that any fractional part of a Double value is truncated during the conversion.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.