Difference between revisions of "Double"

From Lazarus wiki
Jump to navigationJump to search
(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...")
 
Line 6: Line 6:
 
Accuracy: 15 to 17 significant decimal digits precision <br>
 
Accuracy: 15 to 17 significant decimal digits precision <br>
 
Memory requirement: 8 bytes or [[64 bit]]s <br>
 
Memory requirement: 8 bytes or [[64 bit]]s <br>
Property: The single- data-type data field can hold floating-point values ​​and signed and unsigned integer values.
+
Property: The double- 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.
 
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.
  

Revision as of 12:24, 28 March 2018

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 double- 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