Description:
#define IA 16807
#define IM 2147483647
#define AM (1.0/IM)
#define IQ 127773
#define IR 2836
#define MASK 123459876
float ran0(long*idum)
{
long k
float ans
*idum ^= MASK
k=(*idum)/IQ
*idum=IA*(*idum-k*IQ)-IR*k
if (*idum < 0)*idum+= IM
ans=AM*(*idum)
*idum ^= MASK
return ans
}
#undef IA
#undef IM
#undef AM
#undef IQ
#undef IR
#undef MASK
To Search:
File list (Check if you may need any files):
ran1.c
ran0.c
ran2.c
ran3.c