vendredi 22 avril 2016

Online resources that proof that rand() can return 0?

I found only this, which says Returns a pseudo-random integral number in the range between 0 and RAND_MAX..

But 0 and RAND_MAX are incluses? I need values from 0 to 1 (incluses), so:

rand() / double(RAND_MAX)

will works only if rand() can also returns 0 and RAND_MAX.




Aucun commentaire:

Enregistrer un commentaire