*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> gammaf (3)              



NAME    [Toc]    [Back]

     lgamma, lgamma_r, lgammaf, lgammaf_r, gamma, gamma_r, gammaf, gammaf_r,
     tgamma -- log gamma functions, gamma function

LIBRARY    [Toc]    [Back]

     Math Library (libm, -lm)

SYNOPSIS    [Toc]    [Back]

     #include <math.h>

     extern int signgam;

     lgamma(double x);

     lgamma_r(double x, int *signgamp);

     lgammaf(float x);

     lgammaf_r(float x, int *signgamp);

     gamma(double x);

     gamma_r(double x, int *signgamp);

     gammaf(float x);

     gammaf_r(float x, int *signgamp);

     tgamma(double x);

     lgamma(x) and lgammaf(x) return ln|| (x)|.
     The external integer signgam returns the sign of | (x).

     lgamma_r(x, signgamp) and lgammaf_r(x, signgamp) provide the same functionality
 as lgamma(x) and lgammaf(x) but the caller must provide an
     integer to store the sign of | (x).

     gamma(), gammaf(), gamma_r(), and gammaf_r() are deprecated aliases for
     lgamma(), lgammaf()_ lgamma_r(), and lgammaf_r(), respectively.
     tgamma(x) returns | (x), with no effect on signgam.

IDIOSYNCRASIES    [Toc]    [Back]

     D_ 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() or lgammaf() has returned can signgam be correct.

     For arguments in its range, tgamma() is preferred, as for positive arguments
 it is accurate to within one unit in the last place.  Exponentiation
 of lgamma() will lose up to 10 significant bits.

RETURN VALUES    [Toc]    [Back]

     gamma(), gamma_r(), gammaf(), gammaf_r(), lgamma(), lgamma_r(),
     lgammaf(), and lgammaf_r() return appropriate values unless an argument
     is out of range.  Overflow will occur for sufficiently large positive
     values, and non-positive integers.  On the VAX, the reserved operator is
     returned, and errno is set to ERANGE.  For large non-integer negative
     values, tgamma() will underflow.

SEE ALSO    [Toc]    [Back]


STANDARDS    [Toc]    [Back]

     The lgamma() and tgamma() functions are expected to conform to ISO/IEC
     9899:1999 (``ISO C99'').

HISTORY    [Toc]    [Back]

     The lgamma() function appeared in 4.3BSD_	The gamma() function appeared
     in 4.4BSD as a function which computed | (x).  This version was used in
     FreeBSD 1.1.  The name gamma() was originally dedicated to the lgamma()
     function, and that usage was restored by switching to Sun's fdlibm in
     FreeBSD 1.1.5.  The tgamma() function appeared in FreeBSD 5.0.

FreeBSD 5.2.1		       December 3, 1992 		 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
lgammaf_r NetBSD log gamma function
gamma IRIX log gamma function
lgammaf NetBSD log gamma function
lgamma NetBSD log gamma function
gammaf_r NetBSD log gamma function
gamma_r NetBSD log gamma function
gamma NetBSD log gamma function
lgamma_r NetBSD log gamma function
gammaf NetBSD log gamma function
lgamma Linux log gamma function
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service