Quote:
Originally Posted by Pierre-Marie Baty
yes... more than 32767 waypoints/nodes/walkfaces/navlinks/whatever.
One reason among others
Also, I assure you that the random results are very convincing : the algorithm is based on an infinite math suite, whose start point is determined by the initial seed - and this implementation is VERY fast, much faster than calling rand() twice. I believe the guy who wrote this did a math paper somewhere, it must be lying around on the net 
|
Yes, it is supposed to be a good random generator algo, look for references
S.K. Park and K.W. Miller, Communications of the ACM 31:10 (Oct 1988, and "Two Fast Implementations of the 'Minimal Standard' Random Number Generator", David G. Carta, Comm. ACM 33, 1 (Jan 1990), p. 87-88 linear congruential generator f(z) = 16807 z mod (2 ** 31 - 1) uses L. Schrage's method to avoid overflow roblems
I found this on-line postscript book http://www.ma.utexas.edu/documentation/nr/bookc/
Look at c7-1.ps it discusses a lot of things, and it says this is probably the simplest and fastest random number generator of all
Code:
unsigned long idnum;
unsigned long lrand( )
{
idnum = 1664525L * idnum + 1013904223L;
return idnum;
}