function bvec_sub_test ( )

%*****************************************************************************80
%
%% bvec_sub_test() tests bvec_sub();
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 January 2015
%
%  Author:
%
%    John Burkardt
%
  n = 10;
  test_num = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'bvec_sub_test():\n' );
  fprintf ( 1, '  bvec_sub() subtracts binary vectors representing integers;\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '        I        J        I - J   BVEC_SUB\n' );
  fprintf ( 1, '\n' );

  for test = 1 : test_num
    
    i = randi ( [ -100, +100 ], 1 );
    j = randi ( [ -100, +100 ], 1 );

    k = i - j;

    bvec1 = i4_to_bvec ( i, n );
    bvec2 = i4_to_bvec ( j, n );
    bvec4 = bvec_sub ( n, bvec1, bvec2 );
    l = bvec_to_i4 ( n, bvec4 );

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

  end

  return
end
