Re: Random Number Generation

2003-01-15 Thread Christopher D . Lewis
On Wednesday, January 15, 2003, at 08:28 AM, Maurice O'Prey wrote: How do I extract a whole number from the rand function. int() is your friend, if you want an integer from rand. I am using rand 25000; which generates a random number with many decimal places, e.g. 16235.2587965, I need a wh

RE: Random Number Generation

2003-01-15 Thread Dylan Boudreau
int(rand 25000) Dylan -Original Message- From: Maurice O'Prey [mailto:[EMAIL PROTECTED]] Sent: January 15, 2003 10:28 AM To: [EMAIL PROTECTED] Subject: Random Number Generation Hi All How do I extract a whole number from the rand function. I am using rand 25000; which genera

RE: Random Number Generation

2003-01-15 Thread Ed Christian
> -Original Message- > From: Maurice O'Prey [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 15, 2003 9:28 AM > Hi All > > How do I extract a whole number from the rand function. > > I am using rand 25000; which generates a random number with > many decimal > places, e.g. 16235.258

Random Number Generation

2003-01-15 Thread Maurice O'Prey
Hi All How do I extract a whole number from the rand function. I am using rand 25000; which generates a random number with many decimal places, e.g. 16235.2587965, I need a whole number as the answer. Sorry if this is simple... Regards Maurice -- To unsubscribe, e-mail: [EMAIL PROTECTED] Fo

RE: Random Number Generation

2001-08-06 Thread Russell Kroboth
$num=(int(rand 35)); There is probably a more random way to do it, but this is what i know... -Original Message- From: Mark Rowlands [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 2:59 AM To: .; Beginners (E-mail) Subject: Re: Random Number Generation On Saturday 04 August

Re: Random Number Generation

2001-08-06 Thread Mark Rowlands
On Saturday 04 August 2001 18:35, . wrote: > Another thing that I notice the llama book fails to mention is random > number generation. Is this possible in Perl? (More specifically in a CGI > script.) could also look at Math::TrulyRandom or Math::Random -- To unsubscribe, e-mai

Re: Random Number Generation

2001-08-05 Thread Abdulaziz Ghuloum
Thanks for the info. Aziz,,, In article <[EMAIL PROTECTED]>, "smoot" <[EMAIL PROTECTED]> wrote: >> "Abdulaziz Ghuloum" <[EMAIL PROTECTED]> said: > >> Doesn't /dev/random produce pseudo-random numbers also? What makes >> reading from it better than using perl's rand or C's rand? > > This is g

Re: Random Number Generation

2001-08-05 Thread Paul Johnson
On Sun, Aug 05, 2001 at 07:31:45AM -1000, . wrote: > > Before 5.004 you did need to seed the PRNG, but I'm not convinced that > > time|$$ was ever a really good choice. Good enough for most purposes > > though, if called only once. > > But why only once? That's the part that confusses me. I t

Re: Random Number Generation

2001-08-04 Thread smoot
> "Abdulaziz Ghuloum" <[EMAIL PROTECTED]> said: > Doesn't /dev/random produce pseudo-random numbers also? What makes > reading from it better than using perl's rand or C's rand? This is getting a bit of topic. /dev/random is seeded with supposedly random events. In Linux I believe it takes t

Re: Random Number Generation

2001-08-04 Thread Abdulaziz Ghuloum
> said: > >> Another thing that I notice the llama book fails to mention is random >> number generation. Is this possible in Perl? (More specifically in a >> CGI script.) > > The rand() function will generate pseudo random numbers. If you need > better random nu

Re: Random Number Generation

2001-08-04 Thread Mike Rodgers
"." wrote: > > Are you sure it's the llama book, not the camel? Either way, blue or pink? > - Original Message - > From: "Mike Rodgers" <[EMAIL PROTECTED]> > To: "." <[EMAIL PROTECTED]> > Sent: Saturday, August 04, 2001