Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Caveat

by jbeninger (Monk)
on Jul 10, 2003 at 14:45 UTC ( #272990=note: print w/ replies, xml ) Need Help??


in reply to Can I seed srand() with results from rand()?

I'm pretty sure (not positive, so someone please correct me if I'm wrong) that rand() has system-specific behaviour, and that if you seed it on a Windows machine, you could get a different sequence from the exact same seed on a BSD machine. This is fine if it's in-house, but if you ever want to be able to say "hey - found a cool sequence - try out seed xxxxx", they might not get the same sequence.

I'm not sure if there's a pure-perl PNRG on CPAN somewhere, but when I came across the problem in a C project, I ended up writing my own. It's a relatively simple algorithm, and a quick google shows up a number of results.


Comment on Caveat

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://272990]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2015-07-05 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (66 votes), past polls