0

I am making a program that has a bunch of embedded if statements. I need random number that are between 0 and 1. In order to get really "random" numbers, I set up the program to get the seed from the cpu time. Then, to get the number between 0 and 1 I was planning to divide by the greatest possible random number from the random() function, but I can't figure out what it is. It is somewhere in the neighborhood of 300000000 ( I just guessed to get that).

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by melissa.johns
0

Another option--Is there a way to put a limit on how big the random() function can be?? then I would know the max.
thanks!

0

ok, I got the drand function working great. I doubt it is super random, but I will deal with that later. At least my numbers are in the right range now.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.