Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - a datum of type "double" is an approximate representation of a real number. http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
A datum of type "double" is an approximate representation of a real number.
The precision of a datum of type "double" is greater than or equal to one
of type "float".  Each datum of type "double" occupies 8 bytes.  If m is the
magnitude of x (an item of type "double") then x can be approximated if


      -1022          1024
     2      <= m <  2

or in more approximate terms if


     2.2250738585072e-308 <= m <= 1.79769313486232e308

Data of type "double" are represented internally as follows.  Note that
bytes are stored in memory with the least significant byte first and the
most significant byte last.


     +---+---------+--------------------------------------+
     | S | Biased  |              Significand             |
     |   | Exponent|                                      |
     +---+---------+--------------------------------------+
      63    62-52                   51-0

Notes:
     

S
    S = Sign bit (0=positive, 1=negative)

Exponent
    The exponent bias is 1023 (i.e., exponent value 1 represents 2**-1022;
    exponent value 1023 represents 2**0; exponent value 2046 represents
    2**1023; etc.).  The exponent field is 11 bits long.

Significand
    The leading bit of the significand is always 1, hence it is not stored
    in the significand field.  Thus the significand is always "normalized".
    The significand field is 52 bits long.

Zero
    A double precision zero quantity occurs when the sign bit, exponent, and
    significand are all zero.

Infinity
    When the exponent field is all 1 bits and the significand field is all
    zero bits then the quantity represents positive or negative infinity,
    depending on the sign bit.

Not Numbers
    When the exponent field is all 1 bits and the significand field is
    non-zero then the quantity is a special value called a NAN
    (Not-A-Number).

    When the exponent field is all 0 bits and the significand field is
    non-zero then the quantity is a special value called a "denormal" or
    nonnormal number.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson