Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rnd function

Status
Not open for further replies.

AlexTardif

Programmer
Apr 11, 2002
14
CA
Hi,

I would like to know what is 'behind' the rnd function. I mean the law that is used to get randomized numbers.

I'm using the randomize function before the rnd and I know how to use them... but what is the code for rnd function?? Must I really trust this function? Is it based on a recognized mathematical function? If it is, which mathematical function is it?

Thanks for help!

Alex
 
rnd has been fairly extensively discussed and evaluated in these fora. You could use "search" to look for some of the threads. Memory is suggesting that many of the posts were in the Ms. A. fora (I recall generating some large tables to evaluate the results).

Ms. appears to have used some very standard techniques, as at least one of the tests appeared to parallel the Ms. results. Memory (again) suggests that the standard Ms. implementation took ~~ 3 days to start repeating the sequence. That was quite sufficient for most purposes.

For testing / comparsion I used the basic algorythms from Numerical Recipies in Fortran Cambridge University Press, 052143064X. Translated to VBA. You should (of course) do your own testing to assure that the procedures are adequate to your purpose(s), however I can suggest the use of your choice of the several numerical recepies publications to review the code and set up your models.

If you sincerely distrust the Ms. function, to the point of needing to validate them, I see no alternative. If casual affermation of the utility of the results is sufficient, I can offer that here and now.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top