DelphiBasics
Extended
Type
The floating point type with the highest capacity and precision System unit
  type Extended;
Description
The Extended type is a floating point type used when the highest exponent and/or significant digits are required.
 
It supports approximately 19 digits of precision in a range from 3.37 x 10-4932 to 1.18 x 104932.
Notes
The Single type is the smallest and fastest, but with worst capacity and precision.

The Double type has medium storage, speed, capacity and performance.

A Extended set to its highest value is treated as Infinity.
Related commands
Currency A decimal type with 4 decimal points used for financial values
Double A floating point type supporting about 15 digits of precision
PExtended Pointer to a Extended floating point value
Single The smallest capacity and precision floating point type
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 Download this web site as a Windows program.




 
Example code : Showing the precision and capacity of Extended values
// Full Unit code.
// -----------------------------------------------------------
// You must store this code in a unit called Unit1 with a form
// called Form1 that has an OnCreate event called FormCreate.
 
unit Unit1;
 
interface
 
uses
  // The System unit does not need to be defined
  SysUtils,
  Forms, Dialogs;
 
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;
 
var
  
Form1: TForm1;
 
implementation
{$R *.dfm} // Include form definitions
 
procedure TForm1.FormCreate(Sender: TObject);

var
  account1, account2, account3, account4 : Extended;
begin
  account1 := 0.1234567890123456789;   // 20 decimal places
  account2 := 3.37E-4932;              // Lowest exponent value
  account3 := 1.18E4932;               // Highest exponent value
  account4 := 1.19E4932;               // Treated as infinite

  ShowMessage('Account1 = '+FloatToStrF(account1, ffGeneral, 22, 20));
  ShowMessage('Account2 = '+FloatToStr(account2));
  ShowMessage('Account3 = '+FloatToStr(account3));
  ShowMessage('Account4 = '+FloatToStr(account4));
end;
 
end.
Hide full unit code
   Account1 = 0.123456789012345679
   Account2 = 3.37E-4932
   Account3 = 1.18E4932
   Account4 = INF
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Home Page