I am trying to generate a random number between two floats (the max is increased by its half)
this is what I have so far but it\'s not working
//ra
Include:
#define ARC4RANDOM_MAX 0x100000000
And then try this:
double val = ((double)arc4random() / ARC4RANDOM_MAX) * (maxRange - minRange) + minRange;
Surely it's:
float randomNumber = ((float)arc4random() / ARC4RANDOM_MAX * (maxRange - minRange)) + minRange;