[java] random numbers in java...?
actually, i don''t think it reaches 1.0.
for example, if u want a random number between 1 and 5, you would do
Math.random()*5 + 1
min is 0.0*5 + 1 = 1
max is .999*5 + 1 = 5.995
for example, if u want a random number between 1 and 5, you would do
Math.random()*5 + 1
min is 0.0*5 + 1 = 1
max is .999*5 + 1 = 5.995
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement