function x = r8vec_shift_circular ( n, x, k )

%*****************************************************************************80
%
%% R8VEC_SHIFT_CIRCULAR performs a circular shift on an R8VEC.
%
%  Discussion:
%
%    An R8VEC is a vector of R8 values.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 August 2018
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of vector entries.
%
%    real X(N), the vector to be shifted.
%
%    integer K, the amount by which each entry is to
%    be shifted.  K should be nonnegative.
%
%  Output:
%
%    real X(N), the shifted vector.
%
  x = x(:);

  x = [ x(n+1-k:n); x(1:n-k) ];

  return
end
