Double

From Lazarus wiki
Revision as of 12:08, 28 March 2018 by Djzepi (talk | contribs) (Created page with "{{Double}} Double is IEEE 754 double-precision binary floating-point format. Value range: 5.0E-324 .. 1.7E308 <br> Accuracy: 15 to 17 significant decimal digits precision <b...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en) suomi (fi) français (fr)

Double is IEEE 754 double-precision binary floating-point format.

Value range: 5.0E-324 .. 1.7E308
Accuracy: 15 to 17 significant decimal digits precision
Memory requirement: 8 bytes or 64 bits
Property: The single- data-type data field can hold floating-point values ​​and signed and unsigned integer values. Assigning other values ​​will result in error messages from the compiler when the program is compiled, and the compile will be aborted. That is, the executable program is not created.

Definition of a data field of data type double:

  var 
    d : Double ;

Examples of assigning valid values:

    d : = - 123.45678 ;
    d : = 0 ;
    d : = 123.45678 ;

Examples of assigning invalid values:

    d : = '-123.45678' ;
    d : = '0' ;
    d : = '123.45678' ;

The difference between the two examples is that the upper example is the assignment of Integer and FloatingCommand literals, while the assignment of the lower example is literals of the String type.

Binary floating-point format

Any value stored as a double requires 64 bits, formatted as shown in the table below:


Bits Usage
63 Sign (0 = positive, 1 = negative)
62 to 52 Exponent, biased by 1023
51 to 0 Fraction f of the number 1.f