function i4_factorial_log_test ( )

%*****************************************************************************80
%
%% i4_factorial_log_test() tests i4_factorial_log().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    05 March 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4_factorial_log_test():\n' );
  fprintf ( 1, '  i4_factorial_log() evaluates the log(N!).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '         N      lfact    elfact    fact\n' );

  n_data = 0;

  while ( true )

    [ n_data, n, fact ] = i4_factorial_values ( n_data );

    if ( n_data == 0 )
      break
    end

    lfact = i4_factorial_log ( n );
    elfact = exp ( lfact );

    fprintf ( 1, '  %8d  %14.6g  %14.6g  %12d\n', n, lfact, elfact, fact );

  end
 
  return
end
