|
��������
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).
|