update chapter2 homework
This commit is contained in:
parent
d0cea6f6cc
commit
ee78c07528
@ -28,7 +28,12 @@ b&=(a+x_{w-1}\cdot y+y_{w-1}\cdot x)\bmod 2^w\\
|
||||
\end{aligned}$$
|
||||
|
||||
## 2.80
|
||||
先得到粗糙的结果 `(x >> 2) + ((x >> 2) << 1)`,再根据 `x & 3` 以及 $x$ 的符号(决定舍入方向)进行修正。
|
||||
$$
|
||||
\texttt{threefourths(x)}=\left\{\begin{aligned}
|
||||
&3\cdot\lfloor x/4\rfloor+x\bmod 3-[x\bmod 3\neq0], &x\ge0\\
|
||||
&3\cdot\lfloor x/4\rfloor+x\bmod 3, &x<0
|
||||
\end{aligned}\right.
|
||||
$$
|
||||
|
||||
## 2.97
|
||||
在某些情况下,舍入会导致最高位变化。对于这种情况,我们要将最低有效位提高一位。
|
||||
在某些情况下,舍入会导致最高位提高一位。对于这种情况,我们要将舍入时的最低有效位相应提高一位。
|
Loading…
x
Reference in New Issue
Block a user