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

后端 未结 9 843
广开言路
广开言路 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 04:59

    I've never encountered a one's complement system, and I've been coding as long as you have.

    But I did encounter a 9's complement system -- the machine language of a HP-41c calculator. I'll admit that this can be considered obsolete, and I don't think they ever had a C compiler for those.

提交回复
热议问题