Page 1 of 1

random numbers

Posted: Tue Oct 25, 2005 7:25 pm
by Luke
what's the best way to generate a random number? rand isn't working very well... keeps giving me the same number.

Posted: Tue Oct 25, 2005 7:28 pm
by feyd
rand() will only give you exact same set if you seed it with the exact same number each pass.. how are you using it?

Re: random numbers

Posted: Tue Oct 25, 2005 7:43 pm
by Chris Corbyn
One armed space goat wrote:what's the best way to generate a random number? rand isn't working very well... keeps giving me the same number.
This made me laugh :lol: "isn't working very well..." .... "keeps giving the same number..." That's fairly random :P

Apologies for the useless input.

Posted: Tue Oct 25, 2005 9:31 pm
by hawleyjr
LOL, everyone knows a computer can't generate a truly random number! Jeesh, don’t you need a Geiger counter for that?

Posted: Tue Oct 25, 2005 9:45 pm
by feyd
hawleyjr wrote:LOL, everyone knows a computer can't generate a truly random number! Jeesh, don’t you need a Geiger counter for that?
You say this in jest, there are actually many sources of excellent entropy available to "normal" computers. Although rarely tapped, one of the great ones is the thermal registers on "modern" processors. There are online sources of high entropy too.. however, software only solutions do not entirely exist (without some hardware support) so... 50/50.. :?