Re: rand() and srand() broken?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=JwNepvi3IAtic/rVKh1dfgqZRY5fFM4GljjkP0jPN10=; b=ZUA35/xenjdVFgDDiXnNlpS+ufRhP53crX3oMYissq6shGyrHTWGUq3sHOA58SkyLe XpaWZfQPKlwVuU4iqidK+kYoxDML5MNBCJ+/AdmRxvjwBDbnpXQ9dsD2CcY3tlX8oQm7 qPTPBcal57xoVaxvYPKiGcAq+S7trhu6+Bck4= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=t3MHHscv+ZWQA96j6DEV0hCYjJKwiS3UgkbZr8G4zXG+mzd0HTzKfoLKxmz5H6iL71 ihW7k2RhG+bu0oRpdqxcdrg7yHUwtRu31u97Pr+I27WGHS0MpTnwXV261gzXZxsgBPbW z+YQEHwuWddTGvIQnV+rdvJfVyvMvLE+irjrE= On Nov 25, 2009, at 11:45 AM, Jens Alfke wrote: Thanks for the reply! Derek _______________________________________________ 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... You shouldn't be using rand; it's not a good PRNG and it was obsoleted ages ago by random(). Even the man page tells you not to use it: Understood... but in an application like mine where I need to query a random number millions of times... random() is much too slow. I think the answer is just to take a few numbers of rand() to get the number I'm looking for.... which is still quite a bit faster than using random(). This email sent to site_archiver@lists.apple.com
participants (1)
-
Derek Gaston