# include # include # include # include "besselj_zero.h" int main ( ); void timestamp ( ); /******************************************************************************/ int main ( ) /******************************************************************************/ /* Purpose: besselj_zero_test() tests besselj_zero(). Licensing: This code is distributed under the MIT license. Modified: 13 June 2025 Author: John Burkardt */ { int i; int n; int nt = 10; double *z0; double *z1; timestamp ( ); printf ( "\n" ); printf ( "besselj_zero_test():\n" ); printf ( " C version\n" ); printf ( " Test besselj_zero()\n" ); n = 0; z0 = jn_zeros ( n, nt ); n = 1; z1 = jn_zeros ( n, nt ); printf ( "\n" ); printf ( " i J0(root i) J1(root i)\n" ); printf ( "\n" ); for ( i = 0; i < nt; i++ ) { printf ( " %2d %14.6g %14.6g\n", i, z0[i], z1[i] ); } free ( z0 ); free ( z1 ); /* Terminate. */ printf ( "\n" ); printf ( "besselj_zero_test():\n" ); printf ( " Normal end of execution.\n" ); timestamp ( ); return 0; } /******************************************************************************/ void timestamp ( ) /******************************************************************************/ /* Purpose: timestamp() prints the current YMDHMS date as a time stamp. Example: 17 June 2014 09:45:54 AM Licensing: This code is distributed under the MIT license. Modified: 01 May 2021 Author: John Burkardt */ { # define TIME_SIZE 40 static char time_buffer[TIME_SIZE]; const struct tm *tm; time_t now; now = time ( NULL ); tm = localtime ( &now ); strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm ); printf ( "%s\n", time_buffer ); return; # undef TIME_SIZE }