#include "rand01.h"

#define IM 4294967296.0 /* Modulus */
#define IA 1664525      /* Multiplier */
#define IC 1013904223   /* Shift */

double rand1(long *idum)    /* Minimal random number generator.  */
                           /* Initialise with idum a pointer to */
                           /* a long. */
{
  unsigned long temp;

  temp=(unsigned long)(*idum) * IA;
  temp+=IC;
  *idum=(long)(temp);
  return temp*1.0/IM;
}
