• Home
  • Blog
  • Basics of Floating Point Numbers Machine Types & Compilers Programming Exercise

Basics of Floating Point Numbers Machine Types & Compilers Programming Exercise

0 comments

  1. Write a program (in C or your choice of language) that determines the smallest floating point number your system can handle. Start with x = 1.0 and divide by 2 repeatedly until x = 0.0. Print the results as you go along. Print both the values and the number of iterations of your loop. Also, include your source code! As always, you should document the environment you are running in.
    Include the output of both of those programs! Advice: you will need to print out the numbers with a higher number of digits of precision than the default.
    1. Tell me what environment you are working in. Machine type, OS, compiler.
    2. Do for type "float".
    3. Do for type "double".
  2. Do the same thing for the largest number.
    1. Do for type "float".
    2. Do for type "double".

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}