.TH j0() "" "" "Mathematics Function (libm)"
.PC "Compute Bessel function"
.B "#include <math.h>"
\fBdouble j0(\fIz\^\fB)\fR
\fBdouble \fIz\^\fB;\fR
.PP
\fBj0()\fR computes the Bessel function of the first kind for order 0 for
its argument
.IR z .
.SH Example
This example, called
.BR bessel.c ,
demonstrates the Bessel functions
.BR j0() ,
.BR j1() ,
and
.BR jn() .
Compile it with the following command line
.DM
	cc -f bessel.c -lm
.DE
.PP
to include floating-point functions and the mathematics library.
.DM
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define display(x) dodisplay((double)(x), #x)
.DE
.DM
dodisplay(value, name)
double value; char *name;
{
	if (errno)
		perror(name);
.DE
.DM
	else
		printf("%10g %s\en", value, name);
	errno = 0;
}
.DE
.DM
main()
{
	extern char *gets();
.br
	double x;
	char string[64];
.DE
.DM
	for(;;) {
		printf("Enter number: ");
		if(gets(string) == NULL)
			break;
		x = atof(string);
.DE
.DM
		display(x);
		display(j0(x));
		display(j1(x));
		display(jn(0,x));
.DE
.DM
		display(jn(1,x));
		display(jn(2,x));
		display(jn(3,x));
	}
}
.DE
.SH "See Also"
.Xr "j1()," j1
.Xr "jn()," jn
.Xr "libm" libm
