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

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]
[holli]: that's an empirical fact btw
[Corion]: holli: Well, there are whites and reds that you can distinguish, as some of the red wines have more tannine which makes the wine taste bitter rather than sour ;)
[Corion]: But other than that, don't judge wines on price, and if you don't like the taste you don't have to drink the wine ;-D

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (11)
As of 2017-09-25 13:20 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (280 votes). Check out past polls.