function dvec_add_test ( )

%*****************************************************************************80
%
%% DVEC_ADD_TEST tests DVEC_ADD.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  n = 10;
  seed = 123456789;
  test_num = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'DVEC_ADD_TEST\n' );
  fprintf ( 1, '  DVEC_ADD adds decimal vectors representing integers;\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '        I        J        K = I + J\n' );
  fprintf ( 1, '\n' );

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

    fprintf ( 1, '\n' );

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

    k = i + j;

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

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

    dvec3 = dvec_add ( n, dvec1, dvec2 );
    k = dvec_to_i4 ( n, dvec3 );

    fprintf ( 1, '  DVEC_ADD  %8d\n', k );

  end

  return
end
