function i4_not_test ( )

%*****************************************************************************80
%
%% i4_not_test() tests i4_not().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 August 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4_not_test():\n' );
  fprintf ( 1, '  i4_not() returns the bitwise NOT of an integer I\n' );
  fprintf ( 1, '  with respect to some maximum value J.\n' );
  fprintf ( 1, '  MATLAB provides a BITCMP operator.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       I       I4_NOT(255)  BITCMP(uint8)\n' );
  fprintf ( 1, '\n' );

  j = 255;

  for test = 1 : 10

    i = randi ( [ 0, 255 ], 1 );
    k = i4_not ( i, j );
%
%  MATLAB:
%
    l = bitcmp ( i, 'uint8' )
%
%  Octave:
%
%   l = bitcmp ( i, 8 );

    fprintf ( 1, '  %6d       %6d       %6d\n', i, k, l );

  end 

  return
end
