/*****************************************************************************

This is file exp1.c.

*****************************************************************************/

#include "exp1.h"

double exp1(long *idum)  /* This uses rand1 to generate 
			   exponential(1) variates.  Scale by 1/lambda 
			   to get exp(lambda) variates.  Initialised 
			   with a pointer to a *negative* integer.  
			   Obviously rand1 must also be compiled! 
			   Change the two occurances of rand1 to rand2 to
			   use with better generator rand2.c.  See notes 
			   for details of rand2.c */
{
  double rand1();
/*  double dum;*/

/*  do
    dum=rand1(idum);
  while (dum == 0.0);*/
/*  return -log(dum);*/
  return -log(rand1(idum));
}
