Sindbad~EG File Manager
/* M. Beeson, for Mathpert */
/*
4.5.91 original date
1.7.97 put in a cast (long) to stop a warning in VC
9.18.97 added export.h etc. for Microsoft compilation
10.7.97 last modified
1.29.98 DEVAL_DLL etc.
6.17.04 removed 16-bit conditional compilation
*/
#define IA 16807
#define IMAX 2147483647L
#define IQ 127773L
#define IR 2836
#include "drandom.h"
double drandom(void)
/* return a random number between 0 and 1 */
/* Adapted from Numerical Recipes p. 279, 2nd edition */
{ long k;
static double idum = 17; /* can be any seed but CANNOT BE ZERO */
k = (long)(idum/IQ);
idum = IA *(idum-k*IQ)-IR*k;
if(idum < 0)
idum += IMAX;
return (1.0/IMAX) * idum;
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists