作者kindaichitom (饭吃到下巴脱臼)
看板TransCSI
标题Re: [问题] 一题补数的问题
时间Sat Mar 14 04:01:06 2009
※ 引述《kindaichitom (饭吃到下巴脱臼)》之铭言:
: 10110111(2进位)是下列哪个数字的2's补数?
: A. 73 B. 81 C. -73 D. -81
: 答案: C.
: 可是我认为是选项A耶...
: 73的二进制 01001001
: 转成1的补数 10110110
: 转成2的补数 10110111
: 所以是73
: 是不是我观念有错还是误解题意呢??
: Thanks!!
今天终於在英文的 wikipedia上看到当初我
发这篇文章的疑惑点,算是ambiguity吧!?
http://en.wikipedia.org/wiki/Two's_complement
这文篇的下面段落在讨论
Potential ambiguities in usage
One should be cautious when using the term two's complement,
as it can mean either a number format or a mathematical operator.
For example 0111 represents 7 in two's-complement notation,
but 1001 is the two's complement of 7, which is the two's complement
representation of –7.
In code notation or conversation the statement
"convert x to two's complement" may be ambiguous,
as it could describe either the change in
representation of x to two's-complement notation from some other format,
or else (if the writer really meant "convert x to its two's complement")
the calculation of the negated value of x.
^^^^^^^
应该是negative?
看了这段讨论我在想这个ambiguity有关系到原先我发问的题目
所以我原来的答案其实也不能算是错的?
thanks!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.228.105.119
※ kindaichitom:转录至看板 ask 03/14 04:02
※ 编辑: kindaichitom 来自: 61.228.105.119 (03/14 04:06)