@
serial 你可知道你有资格钦定什么叫编译器?上面的东西光是喂鸡都够打你多少脸了。(不是我给的,自己翻什么叫 compiler 什么叫 source code ,包括 FSF 的观点上面都有提。)
还“两个符号 0 和 1 ,是最简单的实现”——你特么实现过计算机?没做过别在自己不了解的领域瞎 bb 。
还有……学 C ?这是我这几天看过最好笑的笑话。你不是 C 撸傻了吧,哪来的蜜汁自信在我面前提 C ?我给人校对 C11 和 N1570 的时候咋没发现 C 给你钦定什么 0 什么 1 了。(我看就你这态度这辈子是不用指望给 WG14 舔屁股了……)
看样子你自认为很懂 C 嘛。来来来,给我解释下, ISO C 对 basic source character set 跟 basic execution character set 分别钦定的理由?按你说的 0 和 1 就够的东西,为什么需要那么复杂?是不是说明 C 是辣鸡?
可惜下面“所有的其他运算通过移位、补码、溢出进行换算”就露马脚了。首先浮点打脸啪啪啪。然后就算是整数,哪个逗比 ISA 会拿这种东西“换算”?哦,强行说 C 是嘛,也行:
WG14 N1570
6.2.6.2/2
For signed integer types, the bits of the object representation shall be divided into three
groups: value bits, padding bits, and the sign bit. There need not be any padding bits;
signed char shall not have any padding bits. There shall be exactly one sign bit.
Each bit that is a value bit shall have the same value as the same bit in the object
representation of the corresponding unsigned type (if there are M value bits in the signed
type and N in the unsigned type, then M ≤ N). If the sign bit is zero, it shall not affect
the resulting value. If the sign bit is one, the value shall be modified in one of the
following ways:
— the corresponding value with sign bit 0 is negated (sign and magnitude);
— the sign bit has the value −(2M) (two ’ s complement);
— the sign bit has the value −(2M − 1) (ones ’ complement).
Which of these applies is implementation-defined, as is whether the value with sign bit 1
and all value bits zero (for the first two), or with sign bit and all value bits 1 (for ones ’
complement), is a trap representation or a normal value. In the case of sign and
magnitude and ones ’ complement, if this representation is a normal value it is called a
negative zero.
我甭管你的“补码”脑补成什么词性,告诉我你那坨玩意儿怎么兹瓷 padding bit 跟 trap representation 跟 negative zero 啊,蛤?
跟你说话真 TM 累,你不会连大一学生 C 语言的普及入门课程十有八九是冒牌得被我婊了几年了都不知道吧?