[fpc-pascal] Random(), Randomize, and Linux permissions
cubrewer at yahoo.com
Wed Sep 29 21:03:27 CEST 2004
Thanks for all the suggestions.
Right, if my program were to execute cntinuously while it generated
these random numbers, it would be easy to just call randomize once.
But my program runs very quickly and I'd like it to produce very
random numbers even upon repeated execution of the program. If
nothing else, it's important for my testing of it. As it stands, if
I run it repeatedy without much time between runs I don't just get
similar numbers, I seem to get the exact same sequence. I didn't time
it precisely, but I'd say you want about a second or more to elapse
between calls to Randomize() in order to get different sequences.
Hence my attempt to use /dev/urandom. I had suggested this in a
discussion on this list about a year ago and I thought I would try to
implement it now... I acknowledge the limitations of this approach..
maybe it would be easier to just stick a 1 sec delay before the
BTW, I meant to ask: IIRC, about a year ago someone mentioned that
2.0 would use the Mersenne Twister method. Is that what's in 1.9.4?
Last time I compared FPC's random() to MT, MT was a clear winner.
--- Jonas Maebe <jonas at zeus.ugent.be> wrote:
> On 29 sep 2004, at 08:36, Alan Mead wrote:
> > It's known that Randomize() is not effective when called
> Why do you want to call randomize rapidly? Reading a numbers from
> /dev/random is semantically closer to calling random() a lot than
> calling randomize() a lot.
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal