[Python-checkins] cpython (3.2): Add info from the docstring for random.gammavariate() to the docs.

georg.brandl python-checkins at python.org
Sat Sep 17 20:39:16 CEST 2011


http://hg.python.org/cpython/rev/e6407b2d2f0c
changeset: 72393:e6407b2d2f0c
branch: 3.2
user: Georg Brandl <georg at python.org>
date: Sat Sep 17 20:36:28 2011 +0200
summary:
 Add info from the docstring for random.gammavariate() to the docs.
files:
 Doc/library/random.rst | 7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -163,6 +163,7 @@
 The end-point value ``b`` may or may not be included in the range
 depending on floating-point rounding in the equation ``a + (b-a) * random()``.
 
+
 .. function:: triangular(low, high, mode)
 
 Return a random floating point number *N* such that ``low <= N <= high`` and
@@ -191,6 +192,12 @@
 Gamma distribution. (*Not* the gamma function!) Conditions on the
 parameters are ``alpha > 0`` and ``beta > 0``.
 
+ The probability distribution function is::
+
+ x ** (alpha - 1) * math.exp(-x / beta)
+ pdf(x) = --------------------------------------
+ math.gamma(alpha) * beta ** alpha
+
 
 .. function:: gauss(mu, sigma)
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /