BigInteger Explicit Conversion (Decimal to BigInteger)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

equivalentCodeEntityM:System.Numerics.BigInteger.#ctor(System.Decimal)

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

Namespace:   System.Numerics
Assembly:  System.Numerics (in System.Numerics.dll)

public:
static explicit operator BigInteger (
	Decimal value
)

Parameters

value
Type: System::Decimal

The value to convert to a BigInteger.

Return Value

Type: System.Numerics::BigInteger

An object that contains the value of the value parameter.

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 Decimal 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 Decimal values to BigInteger objects, and then displays the result of each conversion. Note that any fractional part of a Decimal value is truncated during the conversion.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone
Available since 8.1
Return to top
Show: