function binary_to_i4_test ( )

%*****************************************************************************80
%
%% binary_to_i4_test() tests binary_to_i4().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 June 2021
%
%  Author:
%
%    John Burkardt
%
  test_num = 4;

  i4_test = [ 21, -32, 2, 128 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'binary_to_i4_test()\n' );
  fprintf ( 1, '  binary_to_i4() converts a binary to an integer.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  I4 ==> BINARY ==> I4\n' );
  fprintf ( 1, '\n' );

  for test = 1 : test_num
 
    i4 = i4_test(test);
    s = i4_to_binary ( i4 );
    j4 = binary_to_i4 ( s );

    fprintf ( 1, '  %8d  %8s  %8d\n', i4, s, j4 );
 
  end

  return
end
