Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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

by BrowserUk (Patriarch)
on Jul 10, 2003 at 02:03 UTC ( #272874=note: print w/replies, xml ) Need Help??

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

My take on the "don't call srand multiple times" stuff is that doing so is likely to compromise the randomness of the sequences returned by rand rather than improve them as might be naively assumed.

In this case, you specifically want to reproduce the same sequences, and you only intend to call srand once for each sequence, so I would say that you do know what you are doing.

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2022-12-02 06:30 GMT
Find Nodes?
    Voting Booth?