Fix typo in Python equivalent for bit_length.

This commit is contained in:
Mark Dickinson 2008-12-19 17:46:51 +00:00
parent ba666a59db
commit 4b3ed5d8ba
1 changed files with 1 additions and 1 deletions

View File

@ -471,7 +471,7 @@ Additional Methods on Integer Types
Equivalent to::
def bit_length(self):
s = bin(x) # binary representation: bin(-37) --> '-0b100101'
s = bin(self) # binary representation: bin(-37) --> '-0b100101'
s = s.lstrip('-0b') # remove leading zeros and minus sign
return len(s) # len('100101') --> 6