#include <math.h>

double exp2(long *idum,*idum)  /* This uses rand2 to generate */
			/* exponential(1) variates.  Scale by 1/lambda */
			/* to get exp(lambda) variates.  Initialised */
                        /* with a pointer to a *negative* integer.  */
                        /* Obviously rand2 must also be compiled! */
{
  double rand2();
  double dum;

  do
    dum=rand2(idum,idum2);
  while (dum == 0.0);
  return -log(dum);
}

