3 ms·
This assumes negatives are represented as two's-complement, but that's implementation-defined. Testing whether a negative number is even by ANDing it with 1 wo
by bio_end_io_t 8y ago
This assumes negatives are represented as two's-complement, but that's implementation-defined. Testing whether a negative number is even by ANDing it with 1 won't work in a system that uses one's-complement.
- tomp 8y agoWhich systems don't use two's complement?
- hal_9e3 8y agohttps://en.wikipedia.org/wiki/UNIVAC_1100/2200_series#Architecture https://en.wikipedia.org/wiki/UNIVAC_1100/2200_series#Archit... "I'm not dead yet!" https://www.unisys.com/offerings/clearpath-forward/clearpath-forward-products/clearpath-os-2200-software https://www.unisys.com/offerings/clearpath-forward/clearpath... https://en.wikipedia.org/wiki/Ones%27_complement https://en.wikipedia.org/wiki/Ones%27_complement
- jandrese 8y agoA handful of ancient legacy systems. Very few people today need to worry about their webapp being ported over to UNIVAC.
- glangdale 8y agoUnisys apparently ships some emulators of a old system that still use one's complement... much as I hesitate to ever link to any ESR material, there's a good article here: http://esr.ibiblio.org/?p=7413 http://esr.ibiblio.org/?p=7413