Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Random Number Generator

by RichardK (Parson)
on Aug 20, 2013 at 10:10 UTC ( #1050169=note: print w/replies, xml ) Need Help??


in reply to Random Number Generator

What made you think the rand function is time based?

Try adding srand(1000) to the start of your code and see what happens. You're just wasting time with those usleeps.

Designing a good random number generator isn't easy, so it's better to use one of the RNG modules that has been properly tested. see rand for some suggestions.

The maths behind random number generators and their proper testing is really interesting and well worth some study, if you have the time.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050169]
help
Chatterbox?
[Discipulus]: get them all printed on screen
Discipulus ;=)
[shmem]: silly question, silly answer:
[Discipulus]: i know, i know..
[shmem]: man perlfunc |perl -nle '$ok++ if /Alphabetical Listing of Perl Functions/;if($ok ){$s{$1}++if /^ (\w+)/}}{for(keys %s){$f="prototype \\\&CORE::$_"; eval"$f"||delete $CORE::{$_}}print for sort keys%CORE::'
[shmem]: well, there are some builtins which don't have a prototype...
[Discipulus]: eh eh.. i was looking in toke.c but dunno if is already used

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2017-05-23 10:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?