mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-46737: Add default arguments to random.gauss and normalvariate (GH-31360)
This commit is contained in:
parent
1d81fdc4c0
commit
08ec80113b
4 changed files with 16 additions and 4 deletions
|
@ -538,7 +538,7 @@ class Random(_random.Random):
|
|||
low, high = high, low
|
||||
return low + (high - low) * _sqrt(u * c)
|
||||
|
||||
def normalvariate(self, mu, sigma):
|
||||
def normalvariate(self, mu=0.0, sigma=1.0):
|
||||
"""Normal distribution.
|
||||
|
||||
mu is the mean, and sigma is the standard deviation.
|
||||
|
@ -559,7 +559,7 @@ class Random(_random.Random):
|
|||
break
|
||||
return mu + z * sigma
|
||||
|
||||
def gauss(self, mu, sigma):
|
||||
def gauss(self, mu=0.0, sigma=1.0):
|
||||
"""Gaussian distribution.
|
||||
|
||||
mu is the mean, and sigma is the standard deviation. This is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue