]> granicus.if.org Git - python/commitdiff
Merged revisions 68378 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Wed, 7 Jan 2009 17:54:07 +0000 (17:54 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Wed, 7 Jan 2009 17:54:07 +0000 (17:54 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68378 | mark.dickinson | 2009-01-07 17:48:33 +0000 (Wed, 07 Jan 2009) | 2 lines

  Issue #4869: clarify documentation for random.expovariate.
........

Doc/library/random.rst
Lib/random.py

index da0e6632f326e052c009e19041ca8e01ef8efe8e..82d2555ceef368f6b25c16dab2e8e656ef3945ab 100644 (file)
@@ -169,9 +169,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 70603ca2ae4ee1584bbaaccd845e68b4b128700c..95f44113bfdc665d111252a6848362f858e9d1ec 100644 (file)
@@ -396,9 +396,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