/* nag_elliptic_integral_complete_K (s21bhc) Example Program. * * Copyright 2008, Numerical Algorithms Group. * * Mark 9, 2009. */ /* Pre-processor includes */ #include #include #include #include #include int main(int argc, char *argv[]) { FILE *fpout; /*Integer scalar and array declarations */ Integer exit_status = 0; Integer ix; /*Double scalar and array declarations */ double dm, k; NagError fail; INIT_FAIL(fail); /* Check for command-line IO options */ fpout = nag_example_file_io(argc, argv, "-results", NULL); fprintf(fpout, "%s\n", "nag_elliptic_integral_complete_K (s21bhc) Example Program Results"); fprintf(fpout, "\n dm nag_elliptic_integral_complete_K\n\n"); for (ix = 1; ix <= 3; ix++) { dm = ix*0.250e0; /* * nag_elliptic_integral_complete_K (s21bhc) * Complete elliptic integral of 1st kind, Legendre form, K(m) */ k = nag_elliptic_integral_complete_K(dm, &fail); if (fail.code != NE_NOERROR) { fprintf(fpout, "Error from " "nag_elliptic_integral_complete_K (s21bhc).\n%s\n", fail.message); exit_status = 1; goto END; } fprintf(fpout, "%7.2f%12.4f\n", dm, k); } END: if (fpout != stdout) fclose(fpout); return exit_status; }