paxdiablo paxdiablo - 26 days ago 16
C Question

Are there any non-twos-complement implementations of C?

As we all no doubt know, the ISO C standard (and C++ as well, I think, though I'm more interested on the C side) allows three underlying representations of signed numbers:


  • two's complement;

  • ones' complement; and

  • sign/magnitude.



Wikipedia's entry states that sign/magnitude is used on the IBM 7090 from the 60s, and that ones' complement is used by the PDP-1, CDC 160A and UNIVAC 1100, all of which date back to the 60s as well.

Are there any other implementations of C (or underlying hardware) with these alternative representations, that have come out a little more recently than fifty years ago (and what are they)?

It seems a little wasteful to keep something in a standard for machines no longer in existence.

Answer

The most recent example I can find is the UNISYS 2200 series, based on UNIVAC, with ones-complement arithmetic. The various models were produced between 1986 and 1997 but the OS was still in active development as late as 2015. They also had a C compiler, as seen here.

It seems likely that they may still be in use today.

Comments