Varun Narang <varunar...@gmail.com> writes: > I need some help understanding the right shift operation on -9. To my > understanding, it's represented as -0b1001,
No. Integers are represented using 2s complement integers. So -9 will actually be represented by 0xfffffff7. When you shift it to the right, a '1' is shifted into the empty slot on the left. S you get: 0xfffffffb which is -5. _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers