/* nag_deviates_gamma_dist(g01ffc) Example Program * * Copyright 1990 Numerical Algorithms Group. * * Mark 1, 1990. */ #include #include #include #include int main(void) { double a ,b, p, g; double tol = 0.0; static NagError fail; /* Skip heading in data file */ Vscanf("%*[^\n]"); Vprintf("g01ffc Example Program Results\n"); Vprintf(" p a b g\n\n"); while (scanf("%lf %lf %lf", &p, &a, &b) != EOF) { g = g01ffc(p, a, b, tol, &fail); if (fail.code==NE_NOERROR) Vprintf("%8.3f%8.3f%8.3f%10.3f\n", p, a, b, g); else Vprintf("%8.3f%8.3f%8.3f%10.3f\n Note: %s\n", p, a, b, g, fail.message); } return EXIT_SUCCESS; }