mirror of
https://github.com/python/cpython.git
synced 2026-05-06 04:37:33 -04:00
gh-149221: Minor comment edit (gh-149278)
Minor comment edit
This commit is contained in:
committed by
GitHub
parent
4f0cfe53cb
commit
da09ef807b
+1
-2
@@ -838,9 +838,8 @@ class Random(_random.Random):
|
||||
while True:
|
||||
try:
|
||||
y += _floor(_log2(random()) / c) + 1
|
||||
# The random() function can return 0.0, which causes log2(0.0) to raise a ValueError.
|
||||
# See https://github.com/python/cpython/issue/149221
|
||||
except ValueError:
|
||||
# Reject case where random() returned 0.0
|
||||
continue
|
||||
if y > n:
|
||||
return x
|
||||
|
||||
Reference in New Issue
Block a user