While trying to define random values to a vector, I found that random.random()
only gave a number from 0 to 1, and a google search told me nothing more than that. Appreciate the help
Asked
Active
Viewed 78 times
-1

Tristen Gordon
- 19
- 4
-
5You could do `-1 + 2 * random.random()`, in general you can map to any interval with `min_interval + (max_interval - min_interval) * random.random()` – Dani Mesejo Mar 21 '20 at 20:57