IEEE-754 Floating Point

  1. You must have heard that floating point numbers are stored in computers specified in IEEE-754 standard:
    1. 1 bit for sign (+ or -)
    2. 8 bits for exponent (with bias 127)
    3. 23 bits for mantissa (the leading 1 need not be stored)
  2. You may use online tool like IEEE-754 Floating Point Converter to help you understand the meaning of each bit. Discuss with your neighbors about why a floating number is represented in that bit pattern.
  3. Write a C++ program to dump the bit patterns for 4 bytes in a float.
    ? 1.5
    00000000 00000000 11000000 00111111
    00 00 C0 3F
  4. Discussion: Does the "Little-Endian" rule which you observed in integers also apply for floating points?