[Tutor] 2s complement binary for negative

Ian D duxbuz at hotmail.com
Thu May 1 11:08:21 CEST 2014


Can anyone clarify please?


Just reading this:

https://wiki.python.org/moin/BitwiseOperators


The section on 2's complement binary for negative integers.


It states:


"Thus the number -5 is treated by bitwise operators as if it were written "...1111111111111111111011". "


I am wondering why would this not be -4?


I though -5 would be written ..1111111111111010


5 being 101b


Thanks 		 	   		  


More information about the Tutor mailing list