function dec_to_r8_test ( )

%*****************************************************************************80
%
%% DEC_TO_R8_TEST tests DEC_TO_R8.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    10 June 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'DEC_TO_R8_TEST\n' );
  fprintf ( 1, '  DEC_TO_R8 converts a decimal to a real number.\n' );

  dec_digit = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The number of decimal digits is %d\n', dec_digit );

  r8_lo = -10.0;
  r8_hi = +10.0;
  seed = 123456789;

  fprintf ( 1, '\n' );
  fprintf ( 1, '     R   =>  A * 10^B  =>  R2\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 10
    [ r, seed ] = r8_uniform_ab ( r8_lo, r8_hi, seed );
    [ a, b ] = r8_to_dec ( r, dec_digit );
    r2 = dec_to_r8 ( a, b );
    fprintf ( 1, '  %8f  %6d  %6d  %10f\n', r, a, b, r2 );
  end

  return
end
