function x = poisson_sample ( a )

%*****************************************************************************80
%
%% poisson_sample() samples the Poisson PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 September 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A, the parameter of the PDF.
%    0.0 < A.
%
%  Output:
%
%    integer X, a sample of the PDF.
%
  cdf = rand ( 1, 1 );

  x = poisson_cdf_inv ( cdf, a );

  return
end
