mirror of
https://github.com/python/cpython
synced 2024-09-05 00:05:39 +00:00
bpo-37000: Remove obsolete comment in _randbelow_with_getrandbits (#95775)
This commit is contained in:
parent
41c939cb35
commit
8a55e2f920
|
@ -239,7 +239,7 @@ def _randbelow_with_getrandbits(self, n):
|
|||
"Return a random int in the range [0,n). Defined for n > 0."
|
||||
|
||||
getrandbits = self.getrandbits
|
||||
k = n.bit_length() # don't use (n-1) here because n can be 1
|
||||
k = n.bit_length()
|
||||
r = getrandbits(k) # 0 <= r < 2**k
|
||||
while r >= n:
|
||||
r = getrandbits(k)
|
||||
|
|
Loading…
Reference in a new issue