function i4_mod_inv_test ( )

%*****************************************************************************80
%
%% I4_MOD_INV_TEST tests I4_MOD_INV.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 May 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'I4_MOD_INV_TEST\n' );
  fprintf ( 1, '  I4_MOD_INV finds the inverse of B mod N,\n' );
  fprintf ( 1, '  that is, Y such that ( B * Y ) mod N = 1.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       B       N       Y     B*YmodN\n' );
  fprintf ( 1, '\n' );

  n = 17;
  for b = 1 : 16
    y = i4_mod_inv ( b, n );
    t = mod ( b * y, n );
    fprintf ( 1, '  %6d  %6d  %6d  %6d\n', b, n, y, t );
  end

  return
end