function r8vec_frac_test ( )

%*****************************************************************************80
%
%% r8vec_frac_test() tests r8vec_frac().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2009
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8vec_frac_test():\n' );
  fprintf ( 1, '  r8vec_frac(): K-th smallest real vector entry;\n' );

  n = 10;
  ahi = 10.0;
  alo = 0.0;

  a = alo + ( ahi - alo ) * rand ( n, 1 );

  r8vec_print ( n, a, '  The real array to search: ' );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'Frac   R8VEC_FRAC\n' );
  fprintf ( 1, '\n' );

  for k = 1 : n

    afrac = r8vec_frac ( n, a, k );
    fprintf ( 1, '  %2d  %6f\n', k, afrac );

  end

  return
end
