Today, a important guideline for evaluating a CPU’s performance is itsfloating-point operation capability. Floating-point division unit is a main compo-nent of FPU.
当前评价一个处理器性能的重要指标之一就是其浮点性能的好坏,而浮点除法单元又 FPU 中的重要部件。
参考来源 - 浮点除法/开方算法研究与电路设计·2,447,543篇论文数据,部分数据来源于NoteExpress
本文提出一种用浮点除法来实现整数除法的方法。
A method of integer division using floating-point division is introduced in this paper.
那问题实际是在第四行,应该用浮点除法,结果多打了一个右斜杠,弄成了地板除法,才导致的错误。
The problem is in line 4, which uses floor division instead of floating-point division.
如果我想要得到真正的除法答案,我需要把他们之中的一个,变为浮点数类型。
If I wanted to get full, real division, I should make one of them a float.
So what that means is the compiler is actually going to first "cast" so to speak 13 from whatever it is - to a float -- to a floating point value -- and then perform the division for us.
所以这里的意思是编译器将,做“计算“,譬如13这样一个浮点数,-到另一个浮点数-,然后为我们处理除法。
If I wanted to get full, real division, I should make one of them a float.
如果我想要得到真正的除法答案,我需要把他们之中的一个,变为浮点数类型。
应用推荐