Programming Assignment 2

Answer the following questions.

  1. How  many bits does a typical (Java or C) compiler allocate to a  float ?
  2. What does this mean with respect to the number of real numbers that can be exactly represented ? What about the rest ?
  3. What is the range of real numbers that can be represented by a float ?
  4. Are the 232 bit patterns that can be assigned to a float equally distributed throughout the range ? Or, is the distribution uneven, with a greater proportion assigned to some subranges ? Write a C program that can help you determine the nature of the distribution. 
  5. Does the distribution that you determined above seem reasonable ?

Use a word processor to answer these questions. Turn in your answers and a printout of the C code on or before Friday, September 13, 2002.