#include "rand41.h"

#define IM 4294967296.0  /* Modulus */
#define IA 2650845021UL  /* Multiplier */

double rand1(long *idum)    /* Minimal random number generator.  */
                            /* Initialise with idum a pointer to */
                            /* a long which MUST NOT BE ZERO!!! */
{
  unsigned long temp;

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