function a = i4vec_rotate ( a, m )

%*****************************************************************************80
%
%% i4vec_rotate "rotates" an I4VEC.
%
%  Example:
%
%    Input:
%
%      A = ( 1, 2, 3, 4, 5 )
%      M = 2
%
%    Output:
%
%      A = ( 3, 4, 5, 1, 2 ).
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license. 
%
%  Modified:
%
%    30 May 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer A(N), the array to be rotated.
%
%    integer M, the left shift.
%
%  Output:
%
%    integer A(N), the rotated array.
%
  n = length ( a );
  i = 1 : n;
  i = mod ( i - m - 1, n ) + 1;

  a(i) = a;

  return
end
