Initializes a new instance of the Decimal from an integer array containing a binary representation.
[Visual Basic] Overloads Public Sub New( _ ByVal bits() As Integer _ ) [C#] public Decimal( int[] bits ); [C++] public: Decimal( int* bits[] ); [JScript] public function Decimal( bits : int[] );
Exception Type | Condition |
---|---|
ArgumentException | If the Decimal is null. |
ArgumentException | II the length of the Decimal is not 4 |
ArgumentException | If the representation in the Decimal is not valid. |
This constructor initializes a Decimal from an integer array containing a binary representation. (For additional information, see GetBits.)
Note that there are several possible binary representations for the same numeric value. For example, the value 1 can be represented as {1, 0, 0, 0} (integer value 1 with a scale factor of 0) and equally well as {1000, 0, 0, 0x30000} (integer value 1000 with a scale factor of 3). The possible binary representations of a particular value are all equally valid, and all are numerically equivalent.
The bits argument must be a non-null integer array with four elements.
bits[0], bits[1], and bits[2] contains the low, middle, and high 32 bits of the 96-bit integer part of the Decimal.
bits[3] contains the scale factor and sign of the Decimal:
Bits 0 through 15 (the lower word) are unused and must be 0.
Bits 16-23 must contain a value between 0 and 28, indicating the power of 10 to divide the 96-bit integer part by to produce the Decimal value.
Bits 24-30 are unused and must be 0.
Bit 31 indicates the sign of the Decimal value: 0 meaning positive and 1 meaning negative.
Decimal Structure | Decimal Members | System Namespace | Decimal Constructor Overload List