I was wondering how the Random functions in every programming language works so I want to generate a number by myself i.e. I don't want to use any inbuilt classes or functions.
For simplicity and speed, it's hard to beat the Xorshift random number generator. Whether it generates a good distribution is another question.
One example in C#: http://www.codeproject.com/KB/cs/fastrandom.aspx
Different languages and environments use different random number generators. As others have pointed out, there are lots of ways to generate pseudo-random numbers.
See C# Normal Random Number and other similar Stack Overflow questions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With