/* nag_prob_f_dist (g01edc) Example Program. * * Copyright 1990 Numerical Algorithms Group. * * Mark 1, 1990. */ #include #include #include #include int main(void) { double df1, df2, f, prob; static NagError fail; /* Skip heading in data file */ Vscanf("%*[^\n]"); Vprintf("nag_prob_f_dist (g01edc) Example Program Results\n"); Vprintf(" f df1 df2 prob\n\n"); while (scanf("%lf %lf %lf", &f, &df1, &df2) != EOF) { /* nag_prob_f_dist (g01edc). * Probabilities for F-distribution */ prob = nag_prob_f_dist(Nag_LowerTail, f, df1, df2, &fail); if (fail.code==NE_NOERROR) Vprintf("%6.3f%8.3f%8.3f%8.4f\n", f, df1, df2, prob); else Vprintf("%6.3f%8.3f%8.3f%8.4f\n Note: %s\n",f,df1,df2,prob, fail.message); } return EXIT_SUCCESS; }