dimanche 28 février 2016

How to generate a random double between 0 and a variable in c++

Is there a way of generating a random double between 0 and a variable. The variable is of type double and changes each time the code is run so the range in which the number can be chosen from can vary, but it will always be less than 1. I tried to generate a number and cast it to a double but that didn't work.




Aucun commentaire:

Enregistrer un commentaire