Decimal Constructor (Int32, Int32, Int32, Boolean, Byte)

Decimal Constructor (Int32, Int32, Int32, Boolean, Byte)


Initializes a new instance of Decimal from parameters specifying the instance's constituent parts.

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

new : 
        lo:int *
        mid:int *
        hi:int *
        isNegative:bool *
        scale:byte -> Decimal


Type: System.Int32

The low 32 bits of a 96-bit integer.

Type: System.Int32

The middle 32 bits of a 96-bit integer.

Type: System.Int32

The high 32 bits of a 96-bit integer.

Type: System.Boolean

true to indicate a negative number; false to indicate a positive number.

Type: System.Byte

A power of 10 ranging from 0 to 28.

Exception Condition

scale is greater than 28.

The binary representation of a Decimal number consists of a 1-bit sign, a 96-bit integer number, and a scaling factor used to divide the integer number and specify what portion of it is a decimal fraction. The scaling factor is implicitly the number 10 raised to an exponent ranging from 0 to 28.

The following code example creates several Decimal numbers using the constructor overload that initializes a Decimal structure with three Int32 value words, a Boolean sign, and a Byte scale factor.

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

The following example uses the GetBits method to retrieve the component parts of an array. It then uses this array in the call to the Decimal(Int32, Int32, Int32, Boolean, Byte) constructor to instantiate a new Decimal value.

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

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2016 Microsoft