/* nag_stat_prob_kolmogorov2 (g01ezc) Example Program.
*
* Copyright 2024 Numerical Algorithms Group.
*
* Mark 30.1, 2024.
*/
#include <nag.h>
#include <stdio.h>
int main(void) {
/* Scalars */
double d__, prob;
Integer exit_status, n1, n2;
NagError fail;
INIT_FAIL(fail);
exit_status = 0;
printf("nag_stat_prob_kolmogorov2 (g01ezc) Example Program Results\n\n");
printf(" d n1 n2 Two-sided probability\n\n");
/* Skip heading in data file */
scanf("%*[^\n] ");
while (scanf("%" NAG_IFMT "%" NAG_IFMT "%lf%*[^\n] ", &n1, &n2, &d__) != EOF)
{
/* nag_stat_prob_kolmogorov2 (g01ezc).
* Computes probabilities for the two-sample
* Kolmogorov-Smirnov distribution
*/
prob = nag_stat_prob_kolmogorov2(n1, n2, d__, &fail);
if (fail.code != NE_NOERROR) {
printf("Error from nag_stat_prob_kolmogorov2 (g01ezc).\n%s\n",
fail.message);
exit_status = 1;
goto END;
}
printf("%7.4f%2s%4" NAG_IFMT "%2s%4" NAG_IFMT "%10s%7.4f\n", d__, "", n1,
"", n2, "", prob);
}
END:
return exit_status;
}