So at the moment I'm basically running a test with 2 parameters, amount of numbers randomly generated (N) and the maximum value of which the numbers must not exceed (Y).

and the whichbin function includeCode:for(i = 0; i <= N-1; i++) { double u = gsl_ran_exponential (r, tao); a[i] = u; b = whichbin(bin,a[i],M,Y,i); if (b != -1) { counter[b]++; } printf("%f\n", a[i]); }

If i input 10 and 10 at command prompt, it will translate to 10 numbers with the maximum value of 10, otherwise it will be considered as an outlier.Code:if (a[i] > Y) { printf("Invalid Number:"); b = -1; }

I was wondering, if 1 out of the 10 numbers is an outlier, (i.e output: Invalid Number: 11.243423) , I am left with 9 numbers instead of 10. How can I generate another number when I encounter an outlier? I believe this has something to do with a while statement, something like

but I'm not sure where to place it.Code:while (counter[b] < N)