Name

Double Type

Syntax

type Double;

Description

The Double type is an IEEE standard floating-point type that uses 8 bytes to store a sign bit, an 11-bit exponent, and a 52-bit mantissa. The mantissa is usually normalized, that is, it has an implicit 1 bit before the most significant bit. If the exponent is zero, however, the mantissa is denormalized—without the implicit 1 bit. Thus, the numerical value of +0.0 is represented by all zero bits. An exponent of all 1 bits represents infinity (mantissa is zero) or not-a-number (mantissa is not zero).

The limits of the Double type are approximately 2.23 × 10-308 to 1.79 × 10308, with about 15 decimal digits of precision. Table 5-1 shows the detailed format of finite and special Double values.

Table 5-1. Format of Double Floating-Point Numbers

Numeric class

Sign

Exponent Bits

Mantissa Bits

Positive

   

Normalized

0

0...1 to 1...10

0...0 to 1...1

Denormalized

0

0...0

0...1 to 1...1

Zero

0

0...0

0...0

Infinity

0

1...1

0...0

Signaling NaN

0

1...1

0...1 to 01...1

Quiet NaN

0

1...1

1...0 to 1...1

Negative

   

Normalized

1

0...1 to 1...10

0...0 to 1...1

Denormalized

1

0...0

0...1 to 1...1

Zero

1

0...0

0...0

Infinity

1

1...1

0...0

Signaling NaN

1

1...1

0...1 to 01...1

Quiet NaN

1

1...1

1...0 to 1...1

Tips and Tricks

  • Double is a popular type that provides a good balance between performance and precision.

  • The Double type corresponds to the double type in Java, C, and C++.

  • Refer to the Intel architecture ...

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.