learning-notes icon indicating copy to clipboard operation
learning-notes copied to clipboard

计算机中为什么用补码表示负数?

Open daa233 opened this issue 4 years ago • 1 comments

daa233 avatar Mar 21 '20 08:03 daa233

知乎的这个回答讲得挺好的:原码、反码、补码的产生、应用以及优缺点有哪些? - 脑洞插画铺的回答 - 知乎 https://www.zhihu.com/question/20159860/answer/71256667

  1. 希望正数的编码和负数的编码加在一起刚好是0的编码 (CS107 Lecture 2)
  2. 希望不浪费编码,+0和 -0

daa233 avatar Mar 21 '20 08:03 daa233