jj00() -- Mathematics Function (libm)

Compute Bessel function
#iinncclluuddee <mmaatthh.hh>
ddoouubbllee jj00(_z)
ddoouubbllee _z;

jj00() computes  the Bessel function  of the first  kind for order  0 for its
argument _z.

_E_x_a_m_p_l_e
This  example, called  bbeesssseell.cc,  demonstrates the  Bessel functions  jj00(),
jj11(), and jjnn(). Compile it with the following command line

    cc -f bessel.c -lm

to include floating-point functions and the mathematics library.

#include <errno.h>
#include <math.h>
#include <stdio.h>
#define display(x) dodisplay((double)(x), #x)

dodisplay(value, name)
double value; char *name;
{
    if (errno)
        perror(name);

    else
        printf("%10g %s\n", value, name);
    errno = 0;
}

main()
{
    extern char *gets();
    double x;
    char string[64];

    for(;;) {
        printf("Enter number: ");
        if(gets(string) == NULL)
            break;
        x = atof(string);

        display(x);
        display(j0(x));
        display(j1(x));
        display(jn(0,x));

        display(jn(1,x));
        display(jn(2,x));
        display(jn(3,x));
    }
    putchar('\n');
}

_S_e_e _A_l_s_o
jj11(), jjnn(), lliibbmm
