Server for Information Technologies ������ ��������������
������� �������������� ����������
(095) 932-9212, 932-9213, 939-0783
E-mail: [email protected]
������ �������� ����(!) ������������� ���������� CIT Forum CD-ROM

GAMMA(3M)

��������
gamma - �������� �����-�������

���������

	#include <math.h>
	
	double gamma (x)
	double x;
	
	extern int signgam;

��������
������� gamma ���������� �������� ������������ ��������� �� ���������� �������� ���������������� �������� �����-�������, �� ���� ln(|�(x)|), ��� �(x) ������������ ��� �������� �� t �������

     exp(-t) * t^(x-1)
� �������� �� 0 �� x. ���� �(x) ���������� �� ������� ������������� ���������� signgam. �������� x ����� ���� � ��������������� ������.

��������� �������� ��������� �� ����� C ����� ���� ����������� ��� ���������� �:

     if ((y = gamma(x)) >= LN_MAXDOUBLE)
        error();
     y = signgam * exp(y);

��� LN_MAXDOUBLE - ����������� ��������, ������� ������������� ������ ����������� � ������ �� ���������� ������� �������� ��� ������� exp(3�) � ������� ���������� �� ���������� ����� <values.h>.

��. �����
exp(3M), matherr(3M), values(5).

�����������
��� ��������������� ���������� ������� gamma ���������� �������� HUGE [��. intro(3)], � ������� ���������� errno ������������� �������� EDOM. � ����������� �������� ����� ������ ��������� � ��������� � ����� �������������.

���� ������������� ����������� ��������������� �������� �������� � ������������, �� ������� gamma ���������� �������� HUGE, � ���������� errno ������������� �������� ERANGE.

���������� ��������� ��������� ������ ����� ���� �������� ����������� ������� matherr(3M).
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT