function rat_to_s_test ( )

%*****************************************************************************80
%
%% rat_to_s_test() tests rat_to_s().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 June 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'rat_to_s_test():\n' );
  fprintf ( 1, '  rat_to_s() converts a rational to a string.\n' );

  rat_num = 7;
  rat_top = [ 3, 1,    20,  8, -10,   9, -11 ];
  rat_bot = [ 4, 1000,  1,  4,   7, -15, -11 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '           A           B    A/B\n' );
  fprintf ( 1, '\n' );

  for i = 1 : rat_num
    s = rat_to_s ( rat_top(i), rat_bot(i) );
    fprintf ( 1, '  %10d  %10d    %s\n', rat_top(i), rat_bot(i), s );
  end

  return
end
