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=nyq3AiEg0i9kzH1ECdh+x3KGTUA=; b=CmR9alopGCT/04UjwQgA7J kvPcEgh60T2owuQ7duil42zbf6D9BYm2HFn7oMm0gcdOI3rOSdmSUhxYbqhBmO31 bgTUlMyGd/Gzj2GIk2yUl/YGdvwZgmZ2tvCE1pySWZl+HkVwj1RHdjR4QTiqFkL/ Kgr4lNMqsNBd1a9mID3oo= On 25 Nov 2009, at 17:26, Derek Gaston wrote:
This is actually indicative of what we actually do in one of our applications (I know it doesn't usually make much sense to reseed all the time... but you're just going to have to trust me that it's necessary in our case ;-)
It's wrong. Whether you think it's necessary or not, it's just plain wrong. Pseudo-random number generators usually don't guarantee good output if you re-seed them all the time. Perhaps you should explain the problem that you think requires reseeding every time and someone can help you to design your algorithm better? You might also want to try the random() function rather than the rand() function, since it's usually a better generator. I haven't looked to see whether that's true on OS X, but it normally has a better range and often uses a better algorithm behind the scenes too. 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