Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Can I seed srand() with results from rand()?

by mp (Deacon)
on Jul 10, 2003 at 15:20 UTC ( #273013=note: print w/replies, xml ) Need Help??


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

This thread and its conclusion both dealing with a similar problem of producing repeatable pseudorandom sequences might be helpful to you. I used Math::Random::MT to generate random numbers and seeded it deterministically to get repeatable sequences without touching srand(), since srand()'s seed may have been depended on in other unrelated parts of the application (where less deterministic behavior was needed).

Math::Random::MT keeps the seed state in an object instance, so it makes for easy construction of multiple deterministic pseudorandom sequence generators.

  • Comment on Re: Can I seed srand() with results from rand()?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2022-01-21 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?