/* nag_bessel_k_nu (s18efc) Example Program. * * Copyright 2000 Numerical Algorithms Group. * * NAG C Library * * Mark 6, 2000. */ #include #include #include #include int main(void) { double x; double y; Integer exit_status=0; Integer nu; NagError fail; INIT_FAIL(fail); /* Skip heading in data file */ Vscanf("%*[^\n]"); Vprintf("s18efc Example Program Results\n"); Vprintf(" x nu y\n"); while (scanf("%lf %ld%*[^\n]", &x, &nu) != EOF) { y = s18efc(x, nu, &fail); if (fail.code == NE_NOERROR) Vprintf("%4.1f %6ld %12.4e\n", x, nu, y); else { Vprintf("Error from s18efc.\n%s\n", fail.message); exit_status = 1; goto END; } } END: return exit_status; }