function i4vec_search_binary_a_test ( )

%*****************************************************************************80
%
%% I4VEC_SEARCH_BINARY_A_TEST tests I4VEC_SEARCH_BINARY_A.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 November 2015
%
%  Author:
%
%    John Burkardt
%
  n = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'I4VEC_SEARCH_BINARY_A_TEST\n' );
  fprintf ( 1, '  I4VEC_SEARCH_BINARY_A searches an ascending sorted vector.\n' );

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

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

  b = 5;

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

  index = i4vec_search_binary_a ( 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
