Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC Numerics / Part 1 - The PowerPC Numerics Environment
Chapter 2 - Floating-Point Data Formats


Range and Precision of Data Formats

Table 2-7 shows the precision, range, and memory usage for each numeric data format. You can use this table to compare the data formats and choose which one is needed for your application. Typically, choosing a data format requires that you determine the tradeoffs between

In the table, decimal ranges are expressed as rounded, two-digit decimal representations of the exact binary values. The speed of a given data format varies depending on the particular implementation of PowerPC Numerics. (See Chapter 5, "Conversions," for information on aspects of conversion relating to precision.)
Table 2-7 Summary of PowerPC Numerics data formats
 SingleDoubleDouble-double
Size (bytes:bits)4:328:6416:128
Range of binary exponents    
Minimum -126 -1022 -1022
Maximum12710231023
Significand precision   
Bits2453 107
Decimal digits7-815-16 32
Decimal range (approximate)   
Maximum positive 3.4×10+38 1.8×10+308 1.8×10+308
Minimum positive norm 1.2×10-38 2.2×10-308 2.2×10-308
Minimum positive denorm 1.4×10-45 4.9×10-324 4.9×10-324
Maximum negative denorm -1.4×10-45 -4.9×10-324 -4.9×10-324
Maximum negative norm -1.2×10-38 -2.2×10-308 -2.2×10-308
Minimum negative -3.4×10+38 -1.8×10+308 -1.8×10+308

For example, in single format, the largest representable number is composed as follows:

significand
=(2+-2-23)
=1 .111111111111111111111112
exponent
=127
value
=(2+-2-23)×2127
\xC5 3.403×1038
The smallest positive normalized number representable in single format is made up as follows:

significand
=1
=1 .000000000000000000000002
exponent
=-126
value
=1×2-126
\xC5 1.175×10-38
For denormalized numbers, the smallest positive value representable in the single format is made up as follows:

significand
=2-23
=0 .000000000000000000000012
exponent
=-126
value
=2-23×2-126
\xC5 1.401×10-45


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996