News for hackers. Stuff that matters.
Re:Almost Always Unsigned by jcelerier on Sunday January 02, 2022 @05:37AM (#29767570)
> Signed and unsigned are actually treated internally the same on computers.

if you are writing code in C or C++ the computer you are programming for is the C / C++ abstract machine. C++ recently sanctified complement-of-two as integer representation, but C does not and supports machines with one's complement representation.

Re:Almost Always Unsigned by leni536 on Sunday January 02, 2022 @05:47AM (#29767633)
> C++ recently sanctified complement-of-two as integer representation

While that's true, signed integer overflow on arithmetic operations remains undefined behavior.

Re:Almost Always Unsigned by kryptiskt on Sunday January 02, 2022 @06:57AM (#29768011)
One's complement is on its way out in C too. The next C standard will require two's complement.