function value = r8_aint ( x )

%****************************************************************************80
%
%% r8_aint() truncates an R8 argument to an integer.
%
%  Discussion:
%
%    R8_AINT(R8) is rounded down towards 0.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    18 October 2011
%
%  Author:
%
%    John Burkardt.
%
%  Input:
%
%    real X, the argument.
%
%  Output:
%
%    real VALUE, the truncated version of X.
%
  if ( x < 0.0 )
    value = - floor ( abs ( x ) );
  else
    value =   floor ( abs ( x ) );
  end

  return
end
