tgamma(3) Library Functions Manual tgamma(3) tgamma, tgammaf, tgammal - - (libm, -lm) #include double tgamma(double x); float tgammaf(float x); long double tgammal(long double x); glibc (. feature_test_macros(7)): tgamma(), tgammaf(), tgammal(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L - x. - : Gamma(x) = integral from 0 to infinity of t^(x-1) e^-t dt . m Gamma(m+1) = m! , , x: Gamma(x+1) = x * Gamma(x) , x : Gamma(x) * Gamma(1 - x) = PI / sin(PI * x) Gamma(x). x NaN, NaN. x , . x , , NaN. , , HUGE_VAL, HUGE_VALF HUGE_VALL, , . , , 0 . x -0 +0, , HUGE_VAL, HUGE_VALF HUGE_VALL, , 0. math_error(7), , . : Domain error: x is a negative integer, or negative infinity errno EDOM. (FE_INVALID)). Pole error: x is +0 or -0 errno ERANGE. (FE_DIVBYZERO). : errno ERANGE. (FE_OVERFLOW). glibc , C99 POSIX.1-2001: : (FE_UNDERFLOW) errno ERANGE. attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |tgamma(), tgammaf(), | | MT-Safe | |tgammal() | | | +----------------------------+----------------------------------------------------------+--------------------------+ C11, POSIX.1-2008. glibc 2.1. C99, POSIX.1-2001. << ->> (true gamma function), gamma(3), ( gamma(3)). Before glibc 2.18, the glibc implementation of these functions did not set errno to EDOM when x is negative infinity. Before glibc 2.19, the glibc implementation of these functions did not set errno to ERANGE on an underflow range error. glibc 2.3.3 +0 -0 (errno EDOM FE_INVALID), . gamma(3), lgamma(3) () Azamat Hackimov , Dmitry Bolkhovskikh , Yuri Kozlov , Kirill Rekhov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.15 17 2025 . tgamma(3)