mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-14 02:10:37 +08:00
Use underline format for the technical terms (#1213)
* Use underline format for the technical terms * Bug fixes
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||

|
||||
|
||||
「原码 sign-magnitude」虽然最直观,但存在一些局限性。一方面,**负数的原码不能直接用于运算**。例如在原码下计算 $1 + (-2)$ ,得到的结果是 $-3$ ,这显然是不对的。
|
||||
<u>原码(sign-magnitude)</u>虽然最直观,但存在一些局限性。一方面,**负数的原码不能直接用于运算**。例如在原码下计算 $1 + (-2)$ ,得到的结果是 $-3$ ,这显然是不对的。
|
||||
|
||||
$$
|
||||
\begin{aligned}
|
||||
@@ -29,7 +29,7 @@ $$
|
||||
\end{aligned}
|
||||
$$
|
||||
|
||||
为了解决此问题,计算机引入了「反码 1's complement」。如果我们先将原码转换为反码,并在反码下计算 $1 + (-2)$ ,最后将结果从反码转换回原码,则可得到正确结果 $-1$ 。
|
||||
为了解决此问题,计算机引入了<u>反码(1's complement)</u>。如果我们先将原码转换为反码,并在反码下计算 $1 + (-2)$ ,最后将结果从反码转换回原码,则可得到正确结果 $-1$ 。
|
||||
|
||||
$$
|
||||
\begin{aligned}
|
||||
@@ -51,7 +51,7 @@ $$
|
||||
\end{aligned}
|
||||
$$
|
||||
|
||||
与原码一样,反码也存在正负零歧义问题,因此计算机进一步引入了「补码 2's complement」。我们先来观察一下负零的原码、反码、补码的转换过程:
|
||||
与原码一样,反码也存在正负零歧义问题,因此计算机进一步引入了<u>补码(2's complement)</u>。我们先来观察一下负零的原码、反码、补码的转换过程:
|
||||
|
||||
$$
|
||||
\begin{aligned}
|
||||
|
||||
Reference in New Issue
Block a user