RosettaCodeData/Task/Twos-complement/00-TASK.txt

10 lines
287 B
Plaintext

[[wp:Two's_complement|Two's complement]] is an important concept in representing negative numbers. To turn a positive integer negative, flip the bits and add one.
;Task
Show how to calculate the two's complement of an integer. (It doesn't necessarily need to be a 32 bit integer.)