Math 浮点除法和乘法。如何获得最终尾数?

Math 浮点除法和乘法。如何获得最终尾数?,math,binary,floating-point,division,multiplication,Math,Binary,Floating Point,Division,Multiplication,我知道如何在二进制中加减浮点数。对于乘法和除法,我必须乘/除尾数,加/减指数 但有件事我不明白。尾数是分数,我只学会了整数的乘法和除法。什么规则适用于尾数算术?我见过一些例子,其中乘法尾数被视为整数,但对于除法,余数会发生什么? 有人能提供尾数除法的例子吗?(首选术语是“有效位”。“尾数”是纸质对数表中的遗留术语。) 添加三位有效位的示例: 1.01 +1.11 _____ 11.00 Result >= 10.00, so shift to 1.100, round to 1.10,

我知道如何在二进制中加减浮点数。对于乘法和除法,我必须乘/除尾数,加/减指数 但有件事我不明白。尾数是分数,我只学会了整数的乘法和除法。什么规则适用于尾数算术?我见过一些例子,其中乘法尾数被视为整数,但对于除法,余数会发生什么? 有人能提供尾数除法的例子吗?

(首选术语是“有效位”。“尾数”是纸质对数表中的遗留术语。)

添加三位有效位的示例:

 1.01
+1.11
_____
11.00
Result >= 10.00, so shift to 1.100, round to 1.10, and add one to exponent.

 1.00
+1.11
_____
10.11
Result >= 10.00, so shift to 1.011, round to 1.10, and add one to exponent.
 1.01
-1.10
Note the latter value is larger in magnitude, so swap
them and remember to invert the sign of the result later.
 1.10
-1.01
_____
 0.01
Result < 1.00, so shift to 1.00 and subtract two from exponent.
   1.01
  *1.10
_______
  .0000
  .101
+1.01
_______
 1.1110
Result is in range, so do not shift. Rounding
requires rounding up, producing 10.0, which is
>= 10.0, so shift to 1.00 and add one to exponent.
减去三位有效位的示例:

 1.01
+1.11
_____
11.00
Result >= 10.00, so shift to 1.100, round to 1.10, and add one to exponent.

 1.00
+1.11
_____
10.11
Result >= 10.00, so shift to 1.011, round to 1.10, and add one to exponent.
 1.01
-1.10
Note the latter value is larger in magnitude, so swap
them and remember to invert the sign of the result later.
 1.10
-1.01
_____
 0.01
Result < 1.00, so shift to 1.00 and subtract two from exponent.
   1.01
  *1.10
_______
  .0000
  .101
+1.01
_______
 1.1110
Result is in range, so do not shift. Rounding
requires rounding up, producing 10.0, which is
>= 10.0, so shift to 1.00 and add one to exponent.
请注意,在这些示例中,被加和减的数字的有效位已经对齐。当所加数字的指数相等时,就会发生这种情况。如果不是,则必须移动其中一个数字,使其指数等于另一个,然后可以添加或减去有效位

除法是用你在学校学过的长除法来完成的。对有效位所需的任意数字进行除法,然后在该点使用余数决定是向上取整还是向下取整