Namespaces
Variants
Views
Actions

lgamma

From cppreference.com
< c‎ | numeric‎ | math
Revision as of 18:30, 2 November 2012 by P12bot (Talk | contribs)

 
 
 
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)(C99)(C99)
Exponential functions
(C99)
(C99)
(C99)
(C99)
Power functions
(C99)
(C99)
Trigonometric and hyperbolic functions
(C99)
(C99)
(C99)
Error and gamma functions
(C99)
(C99)
lgamma
(C99)
(C99)
Nearest integer floating point operations
(C99)(C99)(C99)
(C99)
(C99)(C99)(C99)
Floating point manipulation functions
(C99)(C99)
(C99)
(C99)
Classification
(C99)
(C99)
(C99)
Macro constants
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <math.h>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td >
float       lgammaf( float arg );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C99) </td> </tr> <tr class="t-dcl ">

<td >
double      lgamma( double arg );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C99) </td> </tr> <tr class="t-dcl ">

<td >
long double lgammal( long double arg );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C99) </td> </tr> Template:ddcl list end

Computes the natural logarithm of the absolute value of the gamma function of arg.

Contents

Parameters

arg - floating point value

Return value

The value of the logarithm of the gamma function of arg, that is log
e
|
0
targ-1
e-t dt|
.

If arg is a natural number, lgamma(arg) is the logarithm of the factorial of arg-1.

Exceptions

If arg is zero or a negative integer, pole error may occur and FE_INVALID or FE_DIVBYZERO may be raised.

If arg is too large, range error may occur and FE_OVERFLOW may be raised.

Notes

POSIX specification additionally requires that each execution of lgamma stores the sign of the gamma function of arg in the external variable signgam.

See also

Template:c/numeric/math/dcl list tgamma

External links

Weisstein, Eric W. "Log Gamma Function." From MathWorld--A Wolfram Web Resource.