Skip to content

Commit 5c5210e

Browse files
committed
Fix indent and add missing comment
1 parent 8490386 commit 5c5210e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/random.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,9 @@ def binomialvariate(self, n=1, p=0.5):
829829
return x
830830
while True:
831831
try:
832-
y += _floor(_log2(random()) / c) + 1
832+
y += _floor(_log2(random()) / c) + 1
833833
except ValueError:
834+
# Reject case where random() returned 0.0
834835
continue
835836
if y > n:
836837
return x

0 commit comments

Comments
 (0)