function prime_pi_test ( )

%*****************************************************************************80
%
%% prime_pi_test() tests prime_pi().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 December 2022
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../prime_pi' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'prime_pi_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test prime_pi()\n' );

  prime_pi1_test ( );
  prime_pi2_test ( );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'prime_pi_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../prime_pi' );

  return
end
function prime_pi1_test ( )

%*****************************************************************************80
%
%% prime_pi1_test() tests prime_pi1().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 December 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'prime_pi1_test():\n' );
  fprintf ( 1, '  Test prime_pi1()\n' );
  fprintf ( 1, '           n          Pi(n)          prime_pi1(n)\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, n, pi1 ] = pi_values ( n_data );

    if ( n_data == 0 )
      break;
    end

    pi2 = prime_pi1 ( n );

    fprintf ( 1, '%12d  %10d  %10d\n', n, pi1, pi2 );

  end

  return
end
function prime_pi2_test ( )

%*****************************************************************************80
%
%% prime_pi2_test() tests prime_pi2().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 December 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'prime_pi2_test():\n' );
  fprintf ( 1, '  Test prime_pi2()\n' );
  fprintf ( 1, '           n          Pi(n)          prime_pi2(n)\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, n, pi1 ] = pi_values ( n_data );

    if ( n_data == 0 )
      break;
    end

    pi2 = prime_pi2 ( n );

    fprintf ( 1, '%12d  %10d  %10d\n', n, pi1, pi2 );

  end

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

