mirror of
https://github.com/python/cpython.git
synced 2025-11-13 07:26:31 +00:00
#4979: correct result range for some random functions.
This commit is contained in:
parent
60e79ced94
commit
9f7fb849df
1 changed files with 10 additions and 9 deletions
|
|
@ -188,13 +188,13 @@ be found in any statistics text.
|
||||||
|
|
||||||
.. function:: uniform(a, b)
|
.. function:: uniform(a, b)
|
||||||
|
|
||||||
Return a random floating point number *N* such that ``a <= N < b`` for
|
Return a random floating point number *N* such that ``a <= N <= b`` for
|
||||||
``a <= b`` and ``b <= N < a`` for ``b < a``.
|
``a <= b`` and ``b <= N <= a`` for ``b < a``.
|
||||||
|
|
||||||
|
|
||||||
.. function:: triangular(low, high, mode)
|
.. function:: triangular(low, high, mode)
|
||||||
|
|
||||||
Return a random floating point number *N* such that ``low <= N < high`` and
|
Return a random floating point number *N* such that ``low <= N <= high`` and
|
||||||
with the specified *mode* between those bounds. The *low* and *high* bounds
|
with the specified *mode* between those bounds. The *low* and *high* bounds
|
||||||
default to zero and one. The *mode* argument defaults to the midpoint
|
default to zero and one. The *mode* argument defaults to the midpoint
|
||||||
between the bounds, giving a symmetric distribution.
|
between the bounds, giving a symmetric distribution.
|
||||||
|
|
@ -204,8 +204,8 @@ be found in any statistics text.
|
||||||
|
|
||||||
.. function:: betavariate(alpha, beta)
|
.. function:: betavariate(alpha, beta)
|
||||||
|
|
||||||
Beta distribution. Conditions on the parameters are ``alpha > 0`` and ``beta >
|
Beta distribution. Conditions on the parameters are ``alpha > 0`` and
|
||||||
0``. Returned values range between 0 and 1.
|
``beta > 0``. Returned values range between 0 and 1.
|
||||||
|
|
||||||
|
|
||||||
.. function:: expovariate(lambd)
|
.. function:: expovariate(lambd)
|
||||||
|
|
@ -219,14 +219,15 @@ be found in any statistics text.
|
||||||
|
|
||||||
.. function:: gammavariate(alpha, beta)
|
.. function:: gammavariate(alpha, beta)
|
||||||
|
|
||||||
Gamma distribution. (*Not* the gamma function!) Conditions on the parameters
|
Gamma distribution. (*Not* the gamma function!) Conditions on the
|
||||||
are ``alpha > 0`` and ``beta > 0``.
|
parameters are ``alpha > 0`` and ``beta > 0``.
|
||||||
|
|
||||||
|
|
||||||
.. function:: gauss(mu, sigma)
|
.. function:: gauss(mu, sigma)
|
||||||
|
|
||||||
Gaussian distribution. *mu* is the mean, and *sigma* is the standard deviation.
|
Gaussian distribution. *mu* is the mean, and *sigma* is the standard
|
||||||
This is slightly faster than the :func:`normalvariate` function defined below.
|
deviation. This is slightly faster than the :func:`normalvariate` function
|
||||||
|
defined below.
|
||||||
|
|
||||||
|
|
||||||
.. function:: lognormvariate(mu, sigma)
|
.. function:: lognormvariate(mu, sigma)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue