I am trying to generate numbers for a mean interarrival time of 7 seconds. My code is as follows:
randomNumber = (double) rand_r(&randseed)/RAND_MAX;
arrivalTime = -MEAN_INTERARRIVALTIME * log(1 - randomNumber);
arrivalTime = 1000000 * arrivalTime;
MEAN_INTERARRIVALTIME is set to 7 and randseed is 100. When I run my program though, I get really large numbers. Am I doing this completely wrong, or what do I need to change? Thanks in advance.