Jan 17, 2001 #1 Guest_imported New member Joined Jan 1, 1970 Messages 0 When you use a Random number, what is the range? ???(example - 0.0001-.9999)???
Jan 18, 2001 #2 iza Programmer Joined Apr 4, 2000 Messages 1,804 Location FR the range is the one you specify !!!!! by default it should be 0-1 but as you can set it as you want ... Upvote 0 Downvote
the range is the one you specify !!!!! by default it should be 0-1 but as you can set it as you want ...
Jan 18, 2001 #3 luciddream Programmer Joined Nov 8, 2000 Messages 712 Location US Math.random() gives you a random number between 0 and 1. if you want for example a number between 1 and 10, you need Math.round(Math.random() * 10)+1; adam@aauser.com Upvote 0 Downvote
Math.random() gives you a random number between 0 and 1. if you want for example a number between 1 and 10, you need Math.round(Math.random() * 10)+1; adam@aauser.com
Jan 18, 2001 Thread starter #4 Guest_imported New member Joined Jan 1, 1970 Messages 0 On the 0-1, does it have a certain amount of numbers after the decimal point. For example, does it use .178 or would it use just .2 ??? Upvote 0 Downvote
On the 0-1, does it have a certain amount of numbers after the decimal point. For example, does it use .178 or would it use just .2 ???
Jan 18, 2001 #5 jaredn Programmer Joined Sep 1, 1999 Messages 1,506 Location US here's an example number, retrieved by a simple call to Math.random(): 0.22888456018069508 jared@aauser.com Upvote 0 Downvote
here's an example number, retrieved by a simple call to Math.random(): 0.22888456018069508 jared@aauser.com