Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gamma(3) [osf1 man page]

lgamma(3)						     Library Functions Manual							 lgamma(3)

NAME
lgamma, gamma - Compute the logarithm of the gamma function LIBRARY
Math Library (libm.a) SYNOPSIS
#include <math.h> double lgamma (double x); float lgammaf (float x); long double lgammal (long double x); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: lgamma(): XPG4 gamma(): XPG4 Refer to the standards(5) reference page for more information about industry standards and associated tags. DESCRIPTION
The lgamma(), lgammaf(), and lgammal() functions return the logarithm of the absolute value of gamma of x, or ln(|G(x)|), where G is the gamma function. The sign of gamma of x is returned in the external integer variable signgam. The x parameter cannot be 0 or a negative integer. The gamma() function returns the natural log of the gamma function and so is functionally equivalent to lgamma(). Because of this, gamma() is marked TO BE WITHDRAWN in the X/Open Portability Guide, Revision 4 (XPG4). The following table describes function behavior in response to exceptional arguments: ------------------------------------------------------------------------- Function Exceptional Argument Routine Behavior ------------------------------------------------------------------------- lgamma(), lgammaf(), lgamma() |x| = infinity Invalid argument lgamma(), lgammaf(), lgamma() x = 0, -1, -2, -3,... Invalid argument lgamma(), lgammaf(), lgamma() x > lgamma_max_float Overflow ------------------------------------------------------------------------- The following table lists boundary values used by these functions: ------------------------------------------------------------------------- Value Data Hexadecimal Value Decimal Value Name Type ------------------------------------------------------------------------- lgamma_max_float S_FLOAT 7BC650F9 2.0594342e36 T_FLOAT 7F475ABDC501F55F 1.2812545499066958e305 ------------------------------------------------------------------------- delim off lgamma(3)

Check Out this Related Man Page

LGAMMA(3)						   BSD Library Functions Manual 						 LGAMMA(3)

NAME
lgamma, lgammaf, lgamma_r, lgammaf_r, gamma, gammaf, gamma_r, gammaf_r, tgamma, tgammaf -- log gamma function LIBRARY
Math Library (libm, -lm) SYNOPSIS
#include <math.h> extern int signgam; double lgamma(double x); float lgammaf(float x); double lgamma_r(double x, int *sign); float lgammaf_r(float x, int *sign); double gamma(double x); float gammaf(float x); double gamma_r(double x, int *sign); float gammaf_r(float x, int *sign); double tgamma(double x); float tgammaf(float x); DESCRIPTION
_ lgamma(x) returns ln|| (x)|. _ The external integer signgam returns the sign of | (x). _ lgamma_r() is a reentrant interface that performs identically to lgamma(), differing in that the sign of | (x) is stored in the location pointed to by the sign argument and signgam is not modified. _ The tgamma(x) and tgammaf(x) functions return | (x), with no effect on signgam. gamma(), gammaf(), gamma_r(), and gammaf_r() are deprecated aliases for lgamma(), lgammaf(), lgamma_r(), and lgammaf_r(), respectively. IDIOSYNCRASIES
_ Do not use the expression ``signgam*exp(lgamma(x))'' to compute g := | (x). Instead use a program like this (in C): lg = lgamma(x); g = signgam*exp(lg); Only after lgamma() has returned can signgam be correct. RETURN VALUES
lgamma() returns appropriate values unless an argument is out of range. Overflow will occur for sufficiently large positive values, and non- positive integers. For large non-integer negative values, tgamma() will underflow. On the VAX, the reserved operator is returned, and errno is set to ERANGE. SEE ALSO
math(3) HISTORY
The lgamma function appeared in 4.3BSD. The tgamma() function appeared in NetBSD 6.0. BSD
May 4, 2012 BSD
Man Page