src/cui-1.0.4/EAGLS/EAGLS.cpp
static int randomParkAndMiller(long *seed0)
{
	const long a =      16807;
	const long m = 2147483647;
	const long q =     127773;  /* m div a */
	const long r =       2836;  /* m mod a */

	long seed = *seed0;
	long hi   = seed / q;
	long lo   = seed % q;
	long test = a * lo - r * hi;
	if (test > 0)
		seed = test;
	else
		seed = test + m;
	*seed0 = seed;

	return (long)(seed * 4.656612875245797e-10 * 256);
}
/**
 * generates 32 bit pseudo-random numbers.
 * Adapted from http://www.snippets.org
 */
generates 32 bit pseudo-random numbers.
generates 32 bit pseudo - random numbers .
static int randomParkAndMiller(long *seed0)
{
	const long a =      16807;
	const long m = 2147483647;
	const long q =     127773;  
	const long r =       2836;  
	long seed = *seed0;
	long hi   = seed / q;
	long lo   = seed % q;
	long test = a * lo - r * hi;
	if (test > 0)
		seed = test;
	else
		seed = test + m;
	*seed0 = seed;
	return (long)(seed * 4.656612875245797e-10 * 256);
}
static int randomParkAndMiller ( long * seed0 ) { const long a = 16807 ; const long m = 2147483647 ; const long q = 127773 ; const long r = 2836 ; long seed = * seed0 ; long hi = seed / q ; long lo = seed % q ; long test = a * lo - r * hi ; if ( test > 0 ) seed = test ; else seed = test + m ; * seed0 = seed ; return ( long ) ( seed * 4.656612875245797e-10 * 256 ) ; }
generates 32 bit pseudo-random numbers.
generates 32 bit pseudo - random numbers .
/* m div a */ /* m mod a */