mercredi 28 décembre 2016

Putting a constraint on rand.nextDouble()

nextDouble() generates a random double from 0.0 to 1.0.
I want it to generate a random from .05 to .25 (5% - 25%).
However it does not take parameters like nextInt() does.
Any suggestions on how to add constraints to it?




Aucun commentaire:

Enregistrer un commentaire