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
