DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Floating point operations

Special-case values

The following table gives the names of special cases and how each is represented.

Single and Double Precision:

Value Name Sign Exponent Fraction
      MSB Rest of Fraction
NaN (non-trapping) X Max 1 X
Trapping NaN X Max 0 Nonzero
Positive Infinity 0 Max Min  
Negative Infinity 1 Max Min  
Positive Zero 0 Min Min  
Negative Zero 1 Min Min  
Denormalized Number X Min Nonzero  
Normalized Number X NotMM X  

Key:


X
does not matter

Max
maximum value that can be stored in the field (all 1's)

Min
minimum value that can be stored in the field (all 0's)

NaN
not a number

NotMM
field is not equal to either Min or Max values

Nonzero
field contains at least one ``1'' bit

MSB
Most Significant Bit

Double-extended:

Value Name Sign Exponent Fraction
      MSB
Rest of Fraction        
NaN (non-trapping) X Max 1 Nonzero
Trapping NaN X Max 0 Nonzero
Positive Infinity 0 Max 1 Min
Negative Infinity 1 Max 1 Min
Positive Zero 0 Min Min  
Negative Zero 1 Min Min  
Denormalized Number X Min 0 Nonzero
Normalized Number X NotMM 1 X

The algorithm for classification of a value into special cases follows:

If (Exponent==Max)
If (Fraction==Min)
Then the number is Infinity (Positive or Negative
as determined by the Sign bit).
Else the number is NaN (Trapping if FractionMSB==0,
non-Trapping if FractionMSB==1).

Else If (Exponent==Min)
If (Fraction==Min)
Then the number is Zero (Positive or Negative
as determined by the Sign bit).
Else the number is Denormalized.
Else the number is Normalized.


Next topic: NaNs and infinities
Previous topic: Maximum and minimum representable floating point values

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005