[BangPypers] Need help understanding -9 >> 1

Varun Narang varunarang at gmail.com
Fri Jun 29 12:10:30 CEST 2012

Hi all,

I need some help understanding the right shift operation on -9. To my
understanding, it's represented as -0b1001, Now, if I shift it one place to
right, it should give me -0b0100, which is decimal equivalent of 4. but
running this on python console gives me -5.

Please help me out here.


More information about the BangPypers mailing list