site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=alastairs-place.net; h= subject:mime-version:content-type:from:in-reply-to:date:cc: content-transfer-encoding:message-id:references:to; q=dns/txt; s= aug07; bh=fCW2hk85r/409TKifj0fEt6qfEk=; b=UoeH3zwJgY4ad9VLDrsA+k dosvn4WuuAWjPyD4iInavk6M6ODEA0pOqut0Cd52j8oEWqVC8svWu3Gdo1oRFKxF ifqnEM5RdocqBI70p3svYGhUL+yBTLPRCdnmFDIrjUpwBBuGVqq2glVZw0wxslKb rg3VOCfmMxsKlm8yFt8uE= On 25 Nov 2009, at 20:18, Clark Cox wrote:
Indeed... note that this wasn't about passing the _same_ value... it was about passing similar values to srand... like singularly increasing integers...
I was responding specifically to:
"Are you (and everyone else that replied) trying to tell me that the first number out of rand() (after reseeding) should always be the predictable?"
Having read the rest of this thread, I think Derek meant predictable in the sense that given the first value generated after seeding the generator with a value N, the values generated after seeding with N - 1 or N + 1 are "too predictable". His problem really boils down to the fact that rand() makes no guarantees on that front; indeed, nor do most other PRNGs. It's quite normal for even the highest quality PRNG to be seeded using a simpler PRNG when you call a function like srand(), so comparing the first generated value (or even the Nth generated value) is not likely to be a great plan. Kind regards, Alastair. -- http://alastairs-place.net _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Alastair Houghton