function bvec_to_i4_test ( )

%*****************************************************************************80
%
%% bvec_to_i4_test() tests bvec_to_i4();
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  n = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'bvec_to_i4_test():\n' );
  fprintf ( 1, '  bvec_to_i4() converts a signed binary vector\n' );
  fprintf ( 1, '  to an integer;\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  I --> BVEC  -->  I\n' );
  fprintf ( 1, '\n' );

  for i = -3 : 10
    bvec = i4_to_bvec ( i, n );
    i2 = bvec_to_i4 ( n, bvec );
    fprintf ( 1, '  %2d  ', i );
    for j = 1 : n
      fprintf ( 1, '%1d', bvec(j) );
    end
    fprintf ( 1, '  %2d\n', i2 );
  end

  return
end
