Home  |  Delphi .net Home  |  System.Decimal  |  GetBits Method
  
GetBits  
Method  
Converts a Decimal number value into an array of Integers
Decimal Structure
System NameSpace
CF1.  Function GetBits ( Values : Decimal ) : Array of Integer; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Internally, a Decimal number is held in 3 parts :
 
Sign + or -
Mantissa A 96 bit number, holding the significant digits
Exponent 0 to 28 decimal places

 
The Values array returned is filled with 4 Int32 values :
 
Array[0] Low order 32 bits of the mantissa
Array[1] Mid order 32 bits of the mantissa
Array[2] High order 32 bits of the mantissa
Array[3] Exponent in bits 16-23, sign in bit 31
Microsoft MSDN Links
System
System.Decimal
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

var
  intArray : Array of Integer;
  i        : Integer;

begin
  intArray := System.Decimal.GetBits(-1.024);

  for i := 0 to Length(intArray)-1 do
    Console.WriteLine('intArray[{0}] = {1:X} in hex',
                      i.ToString, TObject(intArray[i]));

  Console.ReadLine;
end.
   intArray[0] = 400 in hex
   intArray[1] = 0 in hex
   intArray[2] = 0 in hex
   intArray[3] = 80030000 in hex
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author