develooper Front page | perl.perl5.porters | Postings from March 2001

Re: [ID 20010305.005] "use integer" doesn't make rand() return integers

Thread Previous | Thread Next
From:
John Peacock
Date:
March 5, 2001 13:10
Subject:
Re: [ID 20010305.005] "use integer" doesn't make rand() return integers
Message ID:
3AA40040.81743442@rowman.com
Robert Spier wrote:
> 
> >>>>> "JP" == John Peacock <jpeacock@rowman.com> writes:
>     BUT - to be consistent with the current behaviour of use integer:
> perl -Minteger -le 'print 0+rand' # rinse and repeat
>     it is fine for it always to answer 0.  if you want bigger (random)
> integers, you must specify that.
> 
>     But I don't think the patch should be integrated anyway.  That's
> not what use integer is for.
> 
> -R

I agree that the patch should not go in; my point was I'm not even
sure that int(rand(10)) will not bias the random sequence returned by
rand().  When dealing with random numbers, I know enough to know only 
that I don't know enough!  ;~)

John Peacock

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About