lgamma_r man page on OpenIndiana

Man page or keyword search:  
man Server   20441 pages
apropos Keyword Search (all sections)
Output format
OpenIndiana logo
[printable version]

lgamma(3M)		Mathematical Library Functions		    lgamma(3M)

NAME
       lgamma,	lgammaf,  lgammal, lgamma_r, lgammaf_r, lgammal_r, gamma, gam‐
       maf, gammal, gamma_r, gammaf_r, gammal_r - log gamma function

SYNOPSIS
       c99 [ flag... ] file... -lm [ library... ]
       #include <math.h>

       extern int signgam;

       double lgamma(double x);

       float lgammaf(float x);

       long double lgammal(long double x);

       double gamma(double x);

       float gammaf(float x);

       long double gammal(long double x);

       double lgamma_r(double x, int *signgamp);

       float lgammaf_r(float x, int *signgamp);

       long double lgammal_r(long double x, int *signgamp);

       double gamma_r(double x, int *signgamp);

       float gammaf_r(float x, int *signgamp);

       long double gammal_r(long double x, int *signgamp);

DESCRIPTION
       These functions return

       ln||~(x)|

       where

       |~(x) = integral from 0 to +Infinity of pow(t,x-1)*exp(-t) dt

       for x > 0 and

       |~(x) = n/(|~(1-x)sin(nx))

       for x < 1.

       These functions use the external integer signgam to return the sign  of
       |~(x)  while  lgamma_r()	 and  gamma_r()	 use  the user-allocated space
       addressed by signgamp.

RETURN VALUES
       Upon successful completion,  these  functions  return  the  logarithmic
       gamma of x.

       If x is a non-positive integer, a pole error occurs and these functions
       return +HUGE_VAL, +HUGE_VALF, and +HUGE_VALL, respectively.

       If x is NaN, a NaN is returned.

       If x is 1 or 2, +0 shall be returned.

       If x is ±Inf, +Inf is returned.

ERRORS
       These functions will fail if:

       Pole Error    The x argument is a negative integer or 0.

		     If the integer expression (math_errhandling & MATH_ERREX‐
		     CEPT) is non-zero, then the divide-by-zero floating-point
		     exception is raised.

USAGE
       An application wanting to check for exceptions should  call  feclearex‐
       cept(FE_ALL_EXCEPT)  before  calling  these  functions.	On  return, if
       fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is
       non-zero,  an  exception	 has been raised. An application should either
       examine the return value or check the floating point exception flags to
       detect exceptions.

       In    the    case    of	 lgamma(),   do	  not	use   the   expression
       signgam*exp(lgamma(x)) to compute

       `g  := |~(x)'

       Instead compute lgamma() first:

       lg = lgamma(x); g = signgam*exp(lg);

       only after lgamma() has returned can  signgam  be  correct.  Note  that
       |~(x)  must overflow when x is large enough, underflow when −x is large
       enough, and generate a division by 0 exception at the singularities x a
       nonpositive integer.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌─────────────────────────────┬─────────────────────────────┐
       │      ATTRIBUTE TYPE	     │	    ATTRIBUTE VALUE	   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Interface Stability	     │Committed			   │
       ├─────────────────────────────┼─────────────────────────────┤
       │MT-Level		     │See below.		   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Standard		     │See below.		   │
       └─────────────────────────────┴─────────────────────────────┘

       The  lgamma(),  lgammaf(),  lgammal(),  gamma(), gammaf(), and gammal()
       functions are Unsafe in	multithreaded  applications.  The  lgamma_r(),
       lgammaf_r(),  lgammal_r(),  gamma_r(), gammaf_r(), and gammal_r() func‐
       tions are MT-Safe and should be used instead.

       For lgamma(), lgammaf(), lgammal(), and gamma(), see standards(5).

SEE ALSO
       exp(3M), feclearexcept(3M), fetestexcept(3M), isnan(3M), math.h(3HEAD),
       attributes(5), standards(5)

NOTES
       When  compiling multithreaded applications, the _REENTRANT flag must be
       defined on the compile line.  This flag should only be used  in	multi‐
       threaded applications.

SunOS 5.11			  12 Jul 2006			    lgamma(3M)
[top]

List of man pages available for OpenIndiana

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net