Remix.run Logo
dmitrygr 4 hours ago

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).