function r8vec_frac_test ( )

%*****************************************************************************80
%
%% r8vec_frac_test() tests r8vec_frac().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 April 2009
%
%  Author:
%
%    John Burkardt
%
  n = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8VEC_FRAC_TEST\n' );
  fprintf ( 1, '  R8VEC_FRAC: K-th smallest entry;\n' );

  a = rand ( n, 1 );

  r8vec_print ( n, a, '  Array to search:' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Fractile  Value\n' );
  fprintf ( 1, '\n' );

  for k = 1 : floor ( n / 2 ) : n

    afrac = r8vec_frac ( n, a, k );

    fprintf ( 1, '  %8d  %14f\n', k, afrac );

  end

  return
end
