Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Learn from the given C program to how to print a FP representation of a real num

ID: 644757 • Letter: L

Question

Learn from the given C program to how to print a FP representation of a real number and how to enter a FP number representation directly. a. Verify that infinity and NaN follow the format discussed in class. Specifically, identify the exponent and fraction values for each. Fraction values can be written in binary or hex. b. Modify the program to print the largest negative Single precision FP numbers in scientific notation format. c. Modify the program to print the smallest negative Single precision FP numbers in scientific notation format. d) Include the print of the program and its outputs

Explanation / Answer

Program output is

Floating point 1.000000 is stored as 3f800000                                                                                                                            

                                                                                                                                                                         

Floating point -11.312500 is stored as c1350000                                                                                                                          

                                                                                                                                                                         

The result of 1.000000 divided 0.000000 is inf stored as 7f800000                                                                                                        

                                                                                                                                                                         

The result of inf divided by inf returns nan stored as: ffc00000                                                                                                        

                                                                                                                                                                         

32bit 41fd0000 has floating point value 31.625000                                                                                                                       

Printing in scientific notation: 3.162500e+01   ---------

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote