F
Fernando Barsoba
Hi all,
I think this has been posted many times.. but I tried several recipes
for obtaining a random number between [0,1], but I can't make them work.
So, does anyone know how to generate random number x, for 0<= x <=1??
Thanks,
FBM
That's what I got.......
float rndm = (float) (rand() / RAND_MAX);
and I tried also
float rndm = (float) (rand() % 2);
with no success...
I think this has been posted many times.. but I tried several recipes
for obtaining a random number between [0,1], but I can't make them work.
So, does anyone know how to generate random number x, for 0<= x <=1??
Thanks,
FBM
That's what I got.......
float rndm = (float) (rand() / RAND_MAX);
and I tried also
float rndm = (float) (rand() % 2);
with no success...