]> granicus.if.org Git - python/commitdiff
Issue #4869: clarify documentation for random.expovariate.
authorMark Dickinson <dickinsm@gmail.com>
Wed, 7 Jan 2009 17:48:33 +0000 (17:48 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Wed, 7 Jan 2009 17:48:33 +0000 (17:48 +0000)
Doc/library/random.rst
Lib/random.py

index 858888c9c557a336375923ec41452774385954ee..63c4bc71a5c97d41ba66f72e6faae9ef96e1ab5a 100644 (file)
@@ -210,9 +210,11 @@ be found in any statistics text.
 
 .. function:: expovariate(lambd)
 
-   Exponential distribution.  *lambd* is 1.0 divided by the desired mean.  (The
-   parameter would be called "lambda", but that is a reserved word in Python.)
-   Returned values range from 0 to positive infinity.
+   Exponential distribution.  *lambd* is 1.0 divided by the desired
+   mean.  It should be nonzero.  (The parameter would be called
+   "lambda", but that is a reserved word in Python.)  Returned values
+   range from 0 to positive infinity if *lambd* is positive, and from
+   negative infinity to 0 if *lambd* is negative.
 
 
 .. function:: gammavariate(alpha, beta)
index 5879340a8d461753306ef4146c2ffabd45781eae..8b4c38edb1767219da53817d0b88eff550ee5333 100644 (file)
@@ -413,9 +413,11 @@ class Random(_random.Random):
     def expovariate(self, lambd):
         """Exponential distribution.
 
-        lambd is 1.0 divided by the desired mean.  (The parameter would be
-        called "lambda", but that is a reserved word in Python.)  Returned
-        values range from 0 to positive infinity.
+        lambd is 1.0 divided by the desired mean.  It should be
+        nonzero.  (The parameter would be called "lambda", but that is
+        a reserved word in Python.)  Returned values range from 0 to
+        positive infinity if lambd is positive, and from negative
+        infinity to 0 if lambd is negative.
 
         """
         # lambd: rate lambd = 1/mean