0

Hi,

I want to know what is the logic used for generating a random number. Can anyone tell me the algorithm for random number generation without using standard library functions?

Thanks

4
Contributors
3
Replies
6
Views
11 Years
Discussion Span
Last Post by Narue
0

>I want to know what is the logic used for generating a random number.
There's logic to generating random numbers? :p

>Can anyone tell me the algorithm for random number generation without using standard library functions?
There are a lot of algorithms for random number generation that vary from simplistic and crappy to opaque and excellent. You can have statistically random generators such as linear congruential generators (rand is almost always an LCG) or the vanilla mersenne twister, or cryptographically secure random generators like Blum Blum Shub. What you need it for is very important, but most likely you're just looking for a decent LCG. Rashakil Fol posted my recommendation for a good introduction. ;)

This topic has been dead for over six months. 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.