Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

float(5)                                                           float(5)

NAME
     float - floating types

SYNOPSIS
     #include <float.h>

DESCRIPTION
     The characteristics of floating types are defined in terms of a model
     that describes a representation of floating-point numbers and values
     that provide information about an implementation's floating-point
     arithmetic.

     The following parameters are used to define the model for each
     floating-point type:

     s    sign (+ 1)
     b    base or radix of exponent representation (an integer > 1)
     e    exponent (an integer between a minimum emin and a maximum emax)
     p    precision (the number of base-b digits in the significant)
     fk   non-negative integers less than b (the significant digits)

     A normalized floating-point number x (f1 > 0 if x ≠ 0) is defined by
     the following model:

                   p
     x = s x be x  ≳ fk x b-k, emin < e < emax
                  k=1

     FLTRADIX will be a constant expression suitable for use in the #if
     preprocessing directives. All except FLTRADIX and FLTROUNDS have
     separate names for all three floating-point types. The floating-point
     model representation is provided for all macro names except
     FLTROUNDS.

     The rounding mode for floating-point addition is characterized by the
     value of FLTROUNDS:

     -1   indeterminable
      0   toward 0.0
      1   to nearest
      2   toward positive infinity
      3   toward negative infinity

     All other values for FLTROUNDS characterize implementation-dependent
     rounding behavior.

     The macro names given in the following list will be defined as expres-
     sions with values that are equal or greater in magnitude (absolute
     value) to those shown, with the same sign.






Page 1                       Reliant UNIX 5.44                Printed 11/98

float(5)                                                           float(5)

     ______________________________________________________________________
    |      Name                        Description                   Value|
    |_____________________________________________________________________|
    | FLTRADIX       radix of exponent representation, b               2 |
    |_____________________________________________________________________|
    | FLTMANTDIG    number of base-FLTRADIX digits in the              |
    | DBLMANTDIG    floating-point significant, p                       |
    | LDBLMANTDIG                                                       |
    |_____________________________________________________________________|
    | FLTDIG         number of decimal digits, q, such that any        6 |
    | DBLDIG         floating-point number with q decimal digits      10 |
    | LBLDIG         can be rounded into a floating-point number      10 |
    |                 with p radix b digits and back again without        |
    |                 change to the q decimal digits,                     |
    |                                                                     |
    |                 |                                                   |
    |                 | (p-1) x log10b |   (1  if b is a power of 10      |
    |                                  | + |0  otherwise                  |
    |                                      (                              |
    |_____________________________________________________________________|
    | FLTMINEXP     minimum negative integer such that FLTRADIX        |
    | DBLMINEXP     raised to that power minus 1 is a normalized        |
    | LDBLMINEXP    floating-point number, emin                         |
    |_____________________________________________________________________|
    | FLTMIN10EXP  minimum negative integer such that 10 raised    -37 |
    | DBLMIN10EXP  to that power is in the range of normalized     -37 |
    | LDBLMIN10EXP floating-point numbers,                         -37 |
    |                                                                     |
    |                 |       -1 |                                        |
    |                 |      emin|                                        |
    |                 |log10b    |                                        |
    |                 |          |                                        |
    |_____________________________________________________________________|
    | FLTMAXEXP     maximum integer such that FLTRADIX raised to       |
    | DBLMAXEXP     that power minus 1 is a representable finite        |
    | LDBLMAXEXP    floating-point number, emax                         |
    |_____________________________________________________________________|
    | FLTMAX10EXP  maximum integer such that 10 raised to that      37 |
    | DBLMAX10EXP  power is in the range of representable finite    37 |
    | LDBLMAX10EXP floating-point numbers,                          37 |
    |                                                                     |
    |                 |                    emax  |                        |
    |                 | log10((1 - b-p) x b    ) |                        |
    |                 |                          |                        |
    |_____________________________________________________________________|









Page 2                       Reliant UNIX 5.44                Printed 11/98

float(5)                                                           float(5)

     The macro names given in the following list will be defined as expres-
     sions with values that will be equal to or greater than those shown.
     _____________________________________________________________________
    | FLTMAX         maximum representable finite floating-point   1E+37|
    | DBLMAX         number,                                       1E+37|
    | LDBLMAX                     emax                             1E+37|
    |                 (1 - b-p) x b                                      |
    |____________________________________________________________________|

     The macro names given in the following list will be defined as expres-
     sions with values that will be equal to or less than those shown.
     _____________________________________________________________________
    | FLTEPSILON     the difference between 1.0 and the least      1E-5 |
    | DBLEPSILON     value greater that 1.0 that is representable  1E-9 |
    | LDBLEPSILON    in the given floating-point type, b(1 - p)    1E-9 |
    |____________________________________________________________________|
    | FLTMIN         minimum normalized positive floating-point    1E-37|
    | DBLMIN         number,                                       1E-37|
    | LDBLMIN         (emin -1)                                    1E-37|
    |                 b                                                  |
    |____________________________________________________________________|

































Page 3                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026