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
