function dvec_sub_test ( )

%*****************************************************************************80
%
%% dvec_sub_test() tests dvec_sub();
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 July 2021
%
%  Author:
%
%    John Burkardt
%
  n = 10;
  test_num = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'dvec_sub_test():\n' );
  fprintf ( 1, '  dvec_sub() subtracts decimal vectors representing integers;\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '        I        J        L = I - J\n' );
  fprintf ( 1, '\n' );

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

    fprintf ( 1, '\n' );

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

    l = i - j;

    fprintf ( 1, '  Directly:           %8d\n', l );

    dvec1 = i4_to_dvec ( i, n );
    dvec2 = i4_to_dvec ( j, n );

    dvec4 = dvec_sub ( n, dvec1, dvec2 );
    l = dvec_to_i4 ( n, dvec4 );

    fprintf ( 1, '  DVEC_SUB  %8d\n', l );

  end

  return
end
