lundi 18 novembre 2019

Math.random closed double interval

How do I generate random double values in a closed interval [x;y], e.g. [0;10]? The API of Math.random() says it returns values in [0;1), so multiplying by 10 does not help (as well as multiplying by 11).




Aucun commentaire:

Enregistrer un commentaire