mirror of
https://github.com/python/cpython.git
synced 2024-11-28 20:33:54 +08:00
Minor beautification
This commit is contained in:
parent
a32c4d0531
commit
650c1c9ddd
@ -606,11 +606,11 @@ class Random(_random.Random):
|
|||||||
|
|
||||||
# This version due to Janne Sinkkonen, and matches all the std
|
# This version due to Janne Sinkkonen, and matches all the std
|
||||||
# texts (e.g., Knuth Vol 2 Ed 3 pg 134 "the beta distribution").
|
# texts (e.g., Knuth Vol 2 Ed 3 pg 134 "the beta distribution").
|
||||||
y = self.gammavariate(alpha, 1.)
|
y = self.gammavariate(alpha, 1.0)
|
||||||
if y == 0:
|
if y == 0:
|
||||||
return 0.0
|
return 0.0
|
||||||
else:
|
else:
|
||||||
return y / (y + self.gammavariate(beta, 1.))
|
return y / (y + self.gammavariate(beta, 1.0))
|
||||||
|
|
||||||
## -------------------- Pareto --------------------
|
## -------------------- Pareto --------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user