function i4vec_search_binary_d_test ( )

%*****************************************************************************80
%
%% I4VEC_SEARCH_BINARY_D_TEST tests I4VEC_SEARCH_BINARY_D.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 July 2011
%
%  Author:
%
%    John Burkardt
%
  n = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'I4VEC_SEARCH_BINARY_D_TEST\n' );
  fprintf ( 1, '  I4VEC_SEARCH_BINARY_D searches a descending \n' );
  fprintf ( 1, '  sorted vector.\n' );

  a(1:n) = [ 8, 7, 6, 5, 4, 3, 2, 1, 1, 0 ]';

  i4vec_print ( n, a, '  Descending sorted array:' );

  b = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Now search for an instance of the value %d\n', b );

  index = i4vec_search_binary_d ( n, a, b );

  fprintf ( 1, '\n' );
  if ( index == -1 )
    fprintf ( 1, '  The value does not occur.\n' );
  else
    fprintf ( 1, '  The value occurs at index = %d\n', index );
  end

  return
end
