Question: In this assignment, you'll write a program that will further familiarize you with floating - point numbers and how the operating system treats memory. I
In this assignment, you'll write a program that will further familiarize you with floatingpoint numbers and how the operating system treats memory.
I strongly encourage you to review the page It's Just Memory before spending time on this assignment.
I also encourage you to review the page Processing the command line and the examples I have provided in ~rchaneyClassescssrcargcargv, especially the example file getoptlong.c Using the long options with getopt is considerably more challenging that simple short options. Completing Activity will give you an opportunity to focus on a small example of the use of getoptlong Here are a couple additional examples of using getoptlong:
The GNU example
Linux man page this is the same as the man page on ada
Some Wordpress site
What you must do
Write a program that performs the following tasks. Command line flags should be used to determine which option to run. See man getoptlongLinks to an external site. for details on how to do this. All floating point formats are IEEE unless otherwise noted.
Read in a hex value, and interpret it as a single precision floating point value. hexfloat, x
Read in a hex value, and interpret it as a double precision floating point value. hexdouble, X
Read in a floating point value, and return the hex representation of it in single precision. floathex, f
Read in a floating point value, and return the hex representation of it in double precision floatdouble, d
Read in a double precision floating point value, and print the following interpretations of the bit pattern print, p:
A string of characters consecutive floating point valuesThe hex representation of the valuebit signed integers
littleendianbigendian
bit unsigned integers
littleendianbigendian
bit signed integer
littleendianbigendian
bit unsigned integer
littleendianbigendian
Your program must have a help option which shows usage.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
