function r8_days_to_dhms_test ( )

%*****************************************************************************80
%
%% r8_days_to_dhms_test() tests r8_days_to_dhms().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 July 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8_DAYS_TO_DHMS_TEST\n' );
  fprintf ( 1, '  R8_DAYS_TO_DHMS converts a decimal day to days/hours/minutes/seconds.\n' );
  fprintf ( 1, '  R8_DHMS_TO_DAYS converts a days/hours/minutes/seconds date to days.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '      Days   D   H   M   S            Days\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 5
    days = 5.0 * rand ( 1, 1 );
    [ d, h, m, s ] = r8_days_to_dhms ( days );
    days2 = r8_dhms_to_days ( d, h, m, s );
    fprintf ( 1, '  %8.4f  %2d  %2d  %2d  %8.4f  %8.4f\n', days, d, h, m, s, days2 );
  end

  return
end
