Random Numbers in Perl

Kezdőlap
Csatolmányok:
Üzenet email-ben
+ (text/plain)
Üzenet törlése
Válasz az üzenetre
Szerző: George Gambill
Dátum:  
Tárgy: Random Numbers in Perl
Some systems suggest using the rand() function with a negative seed causing
the system to get the seed from the computer clock. Then they recommend
subsequent rand() function calls without a seed. You may want to play with
this. I have always considered it good enough. YMMV

-----Original Message-----
From: [mailto:sinck@ugive.com]
Sent: Monday, October 23, 2000 7:51 AM
To:
Subject: Re: Random Numbers in Perl



This is an excellent go, and I'll only make one kibbitz technically:

\_         $randigit = int( rand( $base) );


Do you trust rand() to be random?

It's probably mostly random as far as humans can tell, but computers?
rand('maybe', 'maybe not'). :-)

David