Name
Single Type
Syntax
type Single;
Description
The Single
type is an IEEE standard floating-point
type that uses 4 bytes to store a sign bit, an 8-bit exponent, and a
23-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 Single
are roughly 1.18 ×
10-38 to 3.40 × 1038, with about
seven decimal digits of precision. Table 5-3 shows
the detailed format of finite and special Single
values.
Numeric class |
Sign |
Exponent |
Mantissa |
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
The
Single
type corresponds to thefloat
type in Java, C, and C++.Single
is usually used when memory is at a premium. It does not usually offer a performance advantage overDouble
, and it suffers from a limited ...
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.