twos-complement

two's complement of numbers in python

two's complement of numbers in python Question: I am writing code that will have negative and positive numbers all 16 bits long with the MSB being the sign aka two’s complement. This means the smallest number I can have is -32768 which is 1000 0000 0000 0000 in two’s complement form. The largest number I …

Total answers: 6