Java Tick 1*

Floating point numbers in Java have a specific binary representation. In this tick you must write a program to unpack the data held in the Java double primitive type and display it on the screen. The content presented here is described in greater detail in the Floating Point Computation course. To complete this tick you will probably need to consult external documentation such as the Wikipedia article on IEEE 754[1] for a description of how floating point numbers are stored in memory.

Type in the following program into a file with the correct name and directory structure. Follow the instructions in the comments prefixed with TODO. You might find the comments provided before each TODO section helpful. When completing this tick please remember to replace crsid with your username.

You can test your code by providing a floating point number to your program as the first argument on the command line. For example, the representation of one hundred in the primitive type double can be determined using your program as follows:

Once you are happy with your program you should submit it in a jar file named crsid-tick1star.jar. The jar file should have the entry point set to uk.ac.cam.crsid.tick1star.InspectDouble. If you have done this correctly then you should be able to execute the code inside the jar file directly on the command line as follows: