Remix.run Logo
gritzko 4 hours ago

C of course is ancient. It remembers the Cambrian explosion of CPU architectures, twelve-bit bytes and everything like that. I wonder if it is possible to codify some pragmatic subset of it that works nicely on currently available CPUs. Cause the author of the piece goes back in time to prove his point (SPARCs and Alphas).

dmitrygr 4 hours ago | parent [-]

Fun story: even the latest C spec doesn’t require CHAR_BIT == 8, but it does now codify 2s complement int representation. (IIRC)

eru 3 hours ago | parent [-]

For unsigned ints, or also for signed ints?

account42 an hour ago | parent | next [-]

Two's complement is a representation specifically for signed integers.

dmitrygr 3 hours ago | parent | prev [-]

For signed. Unsigned overflow was defined for a while now.

gblargg an hour ago | parent [-]

And unsigned negation is two's complement negation as well (-u = 0-u).