本文提出一种用浮点除法来实现整数除法的方法。
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.
所以这里的意思是编译器将,做“计算“,譬如13这样一个浮点数,-到另一个浮点数-,然后为我们处理除法。
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这样一个浮点数,-到另一个浮点数-,然后为我们处理除法。
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.
应用推荐