Possible Duplicate:
How to generate a random float between 0 and 1?
I want to generate a random number between 0 and 1 (uniform distribution) and I use:
float x = arc4random_uniform(1);
However, this produces only 0.00000
I used
float y = arc4random() %11 * 0.1;
which returns a random number in the interval but I am not sure if it is uniform distribution.
Why isn't the first function working as expected?