I need to generate random real numbers in the range <-0.5; 0.5>, both bounds inclusive.
I found various ways to generate similar ranges, like
-0.5 + Math.random()
But the upper bound is always exclusive, I need it inclusive as well. 0.5 must be inside the range.
Aucun commentaire:
Enregistrer un commentaire