function r8_chop_test ( )

%*****************************************************************************80
%
%% R8_CHOP_TEST tests R8_CHOP.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 July 2018
%
%  Author:
%
%    John Burkardt
%
  x = pi;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8_CHOP_TEST\n' );
  fprintf ( 1, '  R8_CHOP truncates a value to N binary digits.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Here, we chop values of %f\n', x );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   N   X2=R8_CHOP(N,X)  abs(X2-X)\n' );
  fprintf ( 1, '\n' );
     
  for n = 1 : 32
    x2 = r8_chop ( n, x );
    fprintf ( 1, '  %2d  %12.8f  %12.8g\n', n, x2, abs ( x2 - x ) );
  end

  return
end
