From: Andrew Hunt Date: 2000-01-07T13:48:27-05:00 Subject: [ruby-talk:01064] Re: rand() / drand48() > * drand48() requires srand48() before calling it. So we have to > supply some constant (?) seed to srand48() for uninitialized > rand() invocation, if we want this behavior. Do you think > arbitrary integer (say 42) would be sufficient? > > * Perl seems to give up this behavior. Does Ruby really need this > behavoir? Perl's srand defaults to time(0L), but you can also call srand with a constant. I've written a number of programs where I've needed to seed the random number generator with a constant in order to get a predictable, random stream (as for regression testing). Other times of course, I'd want it to be random. Process id and time shifted around a bit makes a nice default, I think, but we still need the ability to seed the generator ourselves. /\ndy