Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: srand producing the same sequence of random numbers

by merlyn (Sage)
on Oct 12, 2010 at 01:12 UTC ( #864721=note: print w/replies, xml ) Need Help??

in reply to srand producing the same sequence of random numbers

The proper way to use srand is to ignore srand, unless you need a repeatable start point, or a cryptographically strong start point (in which case, you're probably not using rand() either). The random number generator is fairly seeded on each new run.

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

  • Comment on Re: srand producing the same sequence of random numbers

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://864721]
[Your Mother]: Haven't seen it, but let me guess. There is a woman and a minority agent and no Germans? Close? :P
[Eily]: you're good :P
[Eily]: except if you count their boss, which is both a woman and from a minority
[LanX]: na, they go easy on germans since they discovered the German TV market
[Your Mother]: Zeitgeist. :P
[LanX]: Talking about Peacemakers, I still need to watch 2 seasons of Farscape ...
[Your Mother]: I liked that show a lot.
[Your Mother]: Packed with minority women.
[LanX]: pitty they burned the actors in Stargate
LanX ... uhm ... wait...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (12)
As of 2018-03-19 14:41 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.