How does genertating random numbers work? I mean I know what it does, but how can I write a function to generate my own totally random numbers.?
How does genertating random numbers work? I mean I know what it does, but how can I write a function to generate my own totally random numbers.?
Thantos, he's asking how he can generate them on his own, without using the standard rand( ) method.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
I think the book called Numerical Recipies talks a lot about this
in the following link scroll down to chapter 7 to read the pdf files
http://www.library.cornell.edu/nr/bookcpdf.html
-Peter
This site explains how to use the generator that your compiler's rand() probably implements. However, linear congruential generators are very bad compared to other generators out there.
http://directory.google.com/Top/Comp..._Numbers/?tc=1
It's hard to know whether rand() or prime() has more coverage.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.