function r8_next_test ( )

%*****************************************************************************80
%
%% R8_NEXT_TEST tests R8_NEXT.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 January 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8_NEXT_TEST\n' );
  fprintf ( 1, '  R8_NEXT computes the "next" real number.\n' );

  x2 = - realmin ( 'double' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Starting at X = %g\n', x2 );
  fprintf ( 1, '       X                         Next X\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 10
    x1 = x2;
    x2 = r8_next ( x1 );
    fprintf ( 1, '  %24.20g  %24.20g\n', x1, x2 );
  end

  x2 = - 1.0;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Starting at X = %g\n', x2 );
  fprintf ( 1, '       X                         Next X\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 5
    x1 = x2;
    x2 = r8_next ( x1 );
    fprintf ( 1, '  %24.20g  %24.20g\n', x1, x2 );
  end

  x2 = 1.0;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Starting at X = %g\n', x2 );
  fprintf ( 1, '       X                         Next X\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 5
    x1 = x2;
    x2 = r8_next ( x1 );
    fprintf ( 1, '  %24.20g  %24.20g\n', x1, x2 );
  end

  x2 = 1000000.0;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Starting at X = %g\n', x2 );
  fprintf ( 1, '       X                         Next X\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 5
    x1 = x2;
    x2 = r8_next ( x1 );
    fprintf ( 1, '  %24.20g  %24.20g\n', x1, x2 );
  end

  x2 = 1000000000000.0;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Starting at X = %g\n', x2 );
  fprintf ( 1, '       X                         Next X\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 5
    x1 = x2;
    x2 = r8_next ( x1 );
    fprintf ( 1, '  %24.20g  %24.20g\n', x1, x2 );
  end

  x2 = 10000000000000000.0;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Starting at X = %g\n', x2 );
  fprintf ( 1, '       X                         Next X\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 5
    x1 = x2;
    x2 = r8_next ( x1 );
    fprintf ( 1, '  %24.20g  %24.20g\n', x1, x2 );
  end

  return
end
