lgamma - C math.h

C examples for math.h:lgamma

Type

function

From

<cmath>
<ctgmath>
<math.h>

Description

Returns the natural logarithm of the absolute value of the gamma function of x.

Prototype

long double lgammal (long double x);
long double lgamma (long double x);
     double lgamma  (double x);
      float lgammaf (float x);
     double lgamma (double x);
      float lgamma (float x);
     double lgamma (T x);           

Parameters

Parameter Description
x Parameter for the log-gamma function.

Return Value

Log-gamma function of x.

Example

Demo Code


#include <stdio.h>
#include <math.h> /* lgamma */

int main ()//from   w  ww. ja  v a2  s.co  m
{
  double param = 1.5;
  
  double result = lgamma (param);
  
  printf ("lgamma(%f) = %f\n", param, result );
  
  return 0;
}

Related Tutorials