InsaneHe / Introduction-to-Computer-Learning-Notes

This is a repository that cosists of my notes produced when learning from “Introduction to Computer” from YouTube: https://www.youtube.com/watch?v=0sNoGFvfmyg
1 stars 0 forks source link

Lec2 Q&A #4

Open FrancoisBlomBrned opened 1 month ago

FrancoisBlomBrned commented 1 month ago
  1. Hardest Question:

By accepting the def of IEEE754 float single precision representation standard, which is like: bit31 : s bit30到bit23 : exponent bit22到bit0: fraction part (and the left-most number of the fraction part is always 1).

Around 250BC, Archimedes in Greece proved that 223/71 < pi < 22/7.

Supposing that he had an IBM PC and let someone input the quotation number 223/71 or 22/7 in c source file ( should be included), they would've perhaos together successfully have "pi" saved inside computer as 0x40490fdb (IEEE single precision représentation) and later also output "pi" in %.20f(小数点后20位小数的形式) format.

So, firstly, what's the Base-2 format of this particular "float number - 0x40490fdb"?

Secondly, the two rational-number-approximation formats of "pi" differs from each other from since which position after floating point? Can you write C program to solve this?

  1. Harder Question:

By accepting the def of IEEE754 float single precision representation standard, which is like: bit31 : s bit30 ~ bit23 : expo-nent bit22 ~ bit0: fraction part (and the left-most number of the fraction part is always 1).

try to transform the following machine numerical float number into decimal version.

x = 10011101 10011001 10011001 10011001 10011000

  1. easier question:

使用基于GNU工具链的gcc或者基于Microsoft工具链的msvc编译环境,输入一下代码(见微信附图1-a-3), 观察程序运行情况,分析执行过程内部原理(提示: 从机器的数的表示的角度入手)