diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-05-23 15:15:30 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-05-23 15:15:30 (GMT) |
commit | 8ac1495a6a1d18111a626cec0c7f2eb67df3edb3 (patch) | |
tree | 2d91993770d3a5b3f3668857983d9bf75276b14f /Lib/random.py | |
parent | f655328483b2e237cc2f71c1c308eceb2f30f6fd (diff) | |
download | cpython-8ac1495a6a1d18111a626cec0c7f2eb67df3edb3.zip cpython-8ac1495a6a1d18111a626cec0c7f2eb67df3edb3.tar.gz cpython-8ac1495a6a1d18111a626cec0c7f2eb67df3edb3.tar.bz2 |
Whitespace normalization.
Diffstat (limited to 'Lib/random.py')
-rw-r--r-- | Lib/random.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/random.py b/Lib/random.py index 72822f2..af788c6 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -445,14 +445,14 @@ class Random: ## -------------------- gamma distribution -------------------- def gammavariate(self, alpha, beta): - + # alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2 - + # Warning: a few older sources define the gamma distribution in terms # of alpha > -1.0 if alpha <= 0.0 or beta <= 0.0: raise ValueError, 'gammavariate: alpha and beta must be > 0.0' - + random = self.random if alpha > 1.0: @@ -463,7 +463,7 @@ class Random: ainv = _sqrt(2.0 * alpha - 1.0) bbb = alpha - LOG4 ccc = alpha + ainv - + while 1: u1 = random() u2 = random() @@ -630,7 +630,7 @@ def _test(N=20000): _test_generator(N, 'vonmisesvariate(0.0, 1.0)') _test_generator(N, 'gammavariate(0.01, 1.0)') _test_generator(N, 'gammavariate(0.1, 1.0)') - _test_generator(N, 'gammavariate(0.1, 2.0)') + _test_generator(N, 'gammavariate(0.1, 2.0)') _test_generator(N, 'gammavariate(0.5, 1.0)') _test_generator(N, 'gammavariate(0.9, 1.0)') _test_generator(N, 'gammavariate(1.0, 1.0)') |