function pi_spigot_test ( )

%*****************************************************************************80
%
%% pi_spigot_test() tests pi_spigot().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 March 2021
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../pi_spigot' )

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

  n = 101;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Compute and print the first %d decimal digits of pi:\n', n );
  fprintf ( 1, '\n' );
  pi_spigot ( n );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Print the correct first 101 digits of pi:\n' );
  fprintf ( 1, '\n' );
  pi_101 ( );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pi_spigot_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../pi_spigot' )

  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

