bumsfeld
Nearly a Posting Virtuoso
1,495 posts since Jul 2005
Reputation Points: 409
Solved Threads: 235
Skill Endorsements: 1
So in the manual, it says
Of course, Python doesn't use 8-bit numbers. It USED to use however many bits were native to your machine, but since that was non-portable, it has recently switched to using an INFINITE number of bits. Thus the number -5 is treated by bitwise operators as if it were written "...1111111111111111111010".
How?! Specifically, how do they do this efficiently?
Jeff
jrcagle
Practically a Master Poster
608 posts since Jul 2006
Reputation Points: 92
Solved Threads: 160
Skill Endorsements: 0
Oh, nevermind. I thought it was saying something else. All it's saying is that when it performs right-shifts, it rolls in the MSB from the left. (Arithmetic instead of Logical shift)
I thought it was saying that it somehow represented negatives as if they had infinite precision, which would be impressive.
Jeff
jrcagle
Practically a Master Poster
608 posts since Jul 2006
Reputation Points: 92
Solved Threads: 160
Skill Endorsements: 0
Question Answered as of 3 Years Ago by
jrcagle,
bumsfeld,
davidjhay
and 3 others