function r8_uniform_01_test ( )

%*****************************************************************************80
%
%% r8_uniform_01_test() tests r8_uniform_01().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 April 2009
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8_UNIFORM_01_TEST\n' );
  fprintf ( 1, '  R8_UNIFORM_01 produces a sequence of random values.\n' );

  key = 123456789;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Using random key %d\n', key );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  key  R8_UNIFORM_01(key)\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 10
    key_old = key;
    [ x, key ] = r8_uniform_01 ( key );
    fprintf ( 1, '  %12d  %14f\n', key, x );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Verify that the sequence can be restarted.\n' );
  fprintf ( 1, '  Set the key back to its original value, and see that\n' );
  fprintf ( 1, '  we generate the same sequence.\n' );

  key = 123456789;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  key  R8_UNIFORM_01(key)\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 10
    key_old = key;
    [ x, key ] = r8_uniform_01 ( key );
    fprintf ( 1, '  %12d  %14f\n', key, x );
  end

  return
end
