Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gamma(3m) [ultrix man page]

gamma(3m)																 gamma(3m)

Name
       gamma, lgamma, signgam - log gamma function

Syntax
       #include <math.h>

       double gamma(x)
       double x;

       double lgamma(x)
       double x;

       extern int

Description			 _			_
       The fu_ction returns ln || (|x|)|.  The sign of | (|x|) is returned in the external integer The following C program might be used to calcu-
       late | :

       y = gamma(x);
       if (y > 88.0)
	    error();
       y = exp(y);
       if(signgam)
	    y = -y;

       The function is another name for the function.

Return Values
       The and functions return NaN when x is NaN or when it is an integer value less than or equal to zero.  On  overflow  and  functions  return
       HUGE_VAL.

Environment
       When your program is compiled using the System V environment for nonpositive integer values, HUGE is returned, and errno is set to EDOM.  A
       message indicating DOMAIN error is printed on the standard error output.

       If the correct value would overflow, returns HUGE and sets errno to ERANGE.

       These error-handling procedures may be changed with the function

See Also
       matherr(3m)

								       RISC								 gamma(3m)

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

We Also Found This Discussion For You

1. Programming

Javascript: gamma approximation

Here is some javascript code that implements the Lanczos approximation to the gamma function (http://en.wikipedia.org/wiki/Lanczos_approximation): <script type="text/javascript"> // Gamma approximation; coefficients used by the GNU Scientific Library function gamma(z) { var p = ; if z... (2 Replies)
Discussion started by: figaro
2 Replies