$30
Assignment 9
Total: 40 Points
General Instruction
• This is a group assignment.
• Submit uncompressed file(s) via BeachBoard (Not email or in class).
1. (40 points) Draw a distribution of 32-bit IEEE 754 floating point numbers.
i. Form a group with up to 5 students.
ii. Find the Assn9.cpp and Assn9.py.
iii. You are asked to implement the function convertFloat, nextFloat and countBetween
in Assn9.cpp.
iv. You can refer Figure 1 and this site to have a high level idea of the IEEE 754
format.
v. Submit a source code and screen shots of the console output and the histogram, they can be same for all of the group members, but submit them individually.
Figure 1: After executing Python3 Assn9.py count.dat
CECS 424 Assignment 9 Page 2 of 2
Expected output
g++ Assn9.cpp -o Assn9.exe; .\Assn9.exe count.dat
i. Floating point number converter.
3.14159 - (0,128,4788187)
ii. Floating point number enumeration.
1th number: 1.4013e-045
2th number: 2.8026e-045
3th number: 4.2039e-045
4th number: 5.60519e-045
5th number: 7.00649e-045
6th number: 8.40779e-045
7th number: 9.80909e-045
8th number: 1.12104e-044
9th number: 1.26117e-044
10th number: 1.4013e-044
iii. Floating point number counting
Number of positive floating point numbers: 2139095039
Number of floating point numbers between 0 and 1: 1065353216
Proportion (# of 0~1) / (# of positive): 49.8039%
iv. Floating point number distribution
The output file is ready. Execute "Python3 Assn9.py count.dat"
Figure 2: After executing Python3 Assn9.py count.dat