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

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

    I work in the telemetry field and we have some of our customers have old analog-to-digital converters that still use 1's complement. I just had to write code the other day to convert from 1's complement to 2's complement in order to compensate.

    So yes, it's still out there (but you're not going to run into it very often).

提交回复
热议问题