mercredi 28 octobre 2015

Random number generator between -1 and 1 in C++ [duplicate]

This question already has an answer here:

The title pretty much says it all. I've looked online but I couldn't find anything for this language. I've seen the following: ((double) rand() / (RAND_MAX)) with no luck. I'd also like to avoid using external library's.

The value should be a float as I'm working out X,Y coordinates.




Aucun commentaire:

Enregistrer un commentaire