On Jun 10, 1:52 am, Steven D'Aprano <ste...@remove.this.cybersource.com.au> wrote: > On Tue, 09 Jun 2009 22:21:26 -0700, John Yeung wrote: > > Therefore, to me the most up-to-date docs (which say > > that uniform(a, b) returns a float in the closed > > interval [a, b]) is closer to correct than before, > > but still fails to point out the full subtlety of > > the behavior. > > Which is?
That uniform(a, b) will return a random float in the semi-open interval [a, b) for certain values of a and b; and in the closed interval [a, b] for other values of a and b. (Swap a and b if a > b.) To me, the fact that you sometimes get a semi-open interval and sometimes a closed interval is worth noting in the docs. John -- http://mail.python.org/mailman/listinfo/python-list