12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

22 chapter 1gives 24-bit precision when the phantom bit is included). Doubles occupy 64 bitsoverall, with 1 bit for the sign, 10 bits for the exponent, and 53 bits for the fractionalmantissa (for 54-bit precision). This means that the exponents and mantissas fordoubles are not simply double those of floats, as we see in Table 1.4. (In addition,the IEEE standard also permits extended precision that goes beyond doubles, but thisis all complicated enough without going into that right now.)To see this scheme in action, look at the 32-bit float representing (1.2):s e fBit position 31 30 23 22 0The sign bit s is in bit position 31, the biased exponent e is in bits 30–23, and thefractional part of the mantissa f is in bits 22–0. Since 8 bits are used to store theexponent e and since 2 8 = 256, e has the range0 ≤ e ≤ 255.The values e =0and 255 are special cases. With bias = 127 10 , the full exponentp = e 10 − 127,and, as indicated in Table 1.4, for singles has the range−126 ≤ p ≤ 127.The mantissa f for singles is stored as the 23 bits in positions 22–0. For normalnumbers, that is, numbers with 0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!