function r8_to_digits_sexagesimal_test ( )

%*****************************************************************************80
%
%% r8_to_digits_sexagesimal_test() tests r8_to_digits_sexagesimal().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 June 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8_to_digits_sexagesimal_test():\n' );
  fprintf ( 1, '  r8_to_digits_sexagesimal() converts a real number \n' );
  fprintf ( 1, '  to its representation in base 60;\n' );

  hundredth = 1.0 / 100.0;
  sqrt2 = sqrt ( 2.0 );
  million = 1000000.0;

  for r8 = [ hundredth, sqrt2, pi, million ]

    n = 8;
    [ d, p ] = r8_to_digits_sexagesimal ( r8, n );

    fprintf ( 1, '\n' );
    fprintf ( 1, '  %d sexagesimal digits of %g\n', n, r8 );
    for i = 1 : n
      fprintf ( 1, '  %d  %2d  %g\n', i, d(i), 60^(p+1-i) );
    end

  end

  return
end
