-1

I want to get a random between two doubles. Example:

0.00 and 0.50

then get random between them output is:

0.23

how do i do this with java

user3813948
  • 363
  • 3
  • 13

1 Answers1

3

Simple, for this range [min,max]

return min + Math.random() * (max - min);
Aviad
  • 1,539
  • 1
  • 9
  • 24