Is one's complement a real-world issue, or just a historical one?

后端 未结 9 799
广开言路
广开言路 2020-11-29 04:53

Another question asked about determining odd/evenness in C, and the idiomatic (x & 1) approach was correctly flagged as broken for one\'s complement-based systems, which

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 05:22

    We got off our last 1960's Honeyboxen sometime last year, which made it our oldest machine on site. It was two's complement. This isn't to say knowing or being aware of one's complement is a bad thing. Just, You will probably never run into one's complement issues today, no matter how much computer archeology they have you do at work.

    The issues you are more likely to run into on the integer side are endian issues (I'm looking at you PDP). Also, you'll run into more "real world" (i.e. today) issues with floating point formats than you will integer formats.

提交回复
热议问题