function [ h, m, s ] = frac_to_hms ( f )

%*****************************************************************************80
%
%% frac_to_hms() converts a fractional day into hours, minutes, seconds.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 April 2013
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real F, a day fraction between 0.0 and 1.0.
%
%  Output:
%
%    integer H, M, S, the equivalent hours, minutes and seconds.
%
  f2 = f;

  f2 = 24.0 * f2;
  h = floor ( f2 );
  f2 = f2 - h;

  f2 = 60.0 * f2;
  m = floor ( f2 );
  f2 = f2 - m;

  f2 = 60.0 * f2;
  s = floor ( f2 );
  f2 = f2 - s;

  return
end
