random number including 1 - i.e. [0,1]

Mark Dickinson dickinsm at gmail.com
Wed Jun 10 13:37:01 EDT 2009


On Jun 10, 6:21 pm, Mensanator <mensana... at aol.com> wrote:
> So, the 2.6.2 documentation is STILL wrong. Before it implied
> it was ALWAYS a semi-open interval, and now it says it's ALWAYS
> a closed interval. But neither is correct.

Exactly which bit of the 2.6.2 documentation do you think is
incorrect?  The documentation for random.uniform says:

"""Return a random floating point number N such that
a <= N <= b for a <= b and b <= N <= a for b < a."""

And that's precisely what it does.  Nowhere does the documentation
say that *every* floating-point number N in the interval [a, b]
can occur.

Mark



More information about the Python-list mailing list