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

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Wed Jun 10 06:28:56 CEST 2009


On Tue, 09 Jun 2009 21:04:49 -0700, Mensanator wrote:

> On Jun 9, 8:28�pm, John Yeung <gallium.arsen... at gmail.com> wrote:
>> On Jun 9, 8:45�pm, Mensanator <mensana... at aol.com> wrote:
>>
>> > On Jun 9, 6:05�pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
>> > wrote:
>> > > py> a+(b-a)*z < b # the expression used for uniform(a,b) False
>> > > py> a+(b-a)*z
>> > > 11.0
>>
>> > What you do with the number after it's created is not random's
>> > concern.
>>
>> Mensanator, you missed Gabriel's point. �What he's saying is that,
>> effectively, random.uniform(a, b) returns a + (b - a) * random.random
>> (). �So z may not be random()'s concern, but it very much is uniform
>> ()'s concern.
>>
>> > > The docs are already updated to reflect
>> > > this:http://svn.python.org/view/python/trunk/Doc/library/
random.rst?r1=687...
>>
>> > The docs are now wrong. Why would they do that?
>>
>> The docs are now... sort of correct. �
> 
> I'm not actually disputing that.


Funny, saying "The docs are now wrong" sure sounds like you're disputing 
that they're correct to me!

> I'm simply puzzled why this issue was
> swept under the rug by pretending it's supposed to work that way.

I'm completely confused. What is "this issue", and why are we 
"pretending" that it's supposed to work "that way"?

Yes, I've read the thread. I still have no idea what you are complaining 
about.


> We're
> not children here, you can explain that what is supposed to work in
> theory sometimes has problems in practice. We're not all going to
> abandon Python and run out and buy Mathematica.
> 
> Look at how the change of random to the Mersenne Twister was handled.
> That's what we, the users, want to see. 

Speak for yourself. What about the change that you think "we, the users", 
want to see?


> Otherwise, it creates endless confusion.

Not as confused as this discussion.


-- 
Steven



More information about the Python-list mailing list