function theResult = student_t(t, v)

% student_t -- Student's t distribution.
%  student(t, v) integrates Student's t probability
%   density function for statistic t, assuming
%   v degrees-of-freedom.  The integration is from
%   -t to t.  See Press, et al., "Numerical Recipes",
%   formula (6.3.9), 1986.
 
% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.
%  All Rights Reserved.
%   Disclosure without explicit written consent from the
%    copyright owner does not constitute publication.
 
% Version of 20-Jan-1999 11:13:55.

if nargout > 0, theResult = []; end

if nargin < 2, help(mfilename), return, end

if ischar(t), t = eval(t); end
if ischar(v), v = eval(v); end

x = v ./ (v + t.^2);

result = 1 - betainc(x, v/2, 1/2);

if nargout > 0
	theResult = result;
else
	disp(result)
end
