On Tue, Feb 18, 2003 at 04:04:57PM -0800, Paul Herman wrote:

> What's the concesus that arc4random() should be a drop-in
> replacement for rand()/random()?  Consider the following that
> caclulates the average of a bunch of random numbers on [0.0, 1.0]:

rand() and random() return signed values (int and long respectively).
arc4random() returns an uint32_t.  This explains the shift of 0.5 in
your result.

Kris

Attachment: msg40005/pgp00000.pgp
Description: PGP signature

Reply via email to