sjmachin at lexicon.net
Fri Nov 17 11:18:57 CET 2006
skoroboga... at gmail.com wrote:
> I can't understand a little thing in bitwise operations.
> 4653896912>>13 = -212992
> In Python and Ruby
> 4653896912>>13 = 568102
> In Python and Ruby - it's ok. I understand.
> How can i do this?
So that someone who knows next-to-nothing about those 2 languages can
If you can answer that question, what part of the Python implementation
If you can't answer it ... is the problem caused by the fact that
4653896912 is, at 9 hex digits, a bit large for a 32-bit integer, those
2 languages don't have longer integers [my guess],
*and*, to quote something I found about PHP while googling,
"In effect the bitwise operations [words "can be" omitted, I presume]
safely applied to integer variables - their effect on booleans,
float/double or string variables can be predicted but are not really
More information about the Python-list