LGAMMA(3) NetBSD Library Functions Manual LGAMMA(3)NAME

lgamma,lgammaf,lgamma_r,lgammaf_r,gamma,gammaf,gamma_r,gammaf_r,tgamma,tgammaf-- log gamma functionLIBRARY

Math Library (libm, -lm)SYNOPSIS

#include <math.h>extern int signgam;doublelgamma(double x);floatlgammaf(float x);doublelgamma_r(double x,int *sign);floatlgammaf_r(float x,int *sign);doublegamma(double x);floatgammaf(float x);doublegamma_r(double x,int *sign);floatgammaf_r(float x,int *sign);doubletgamma(double x);floattgammaf(float x);DESCRIPTION

lgamma(x) returns ln||¯(x)|. The external integersigngamreturns the sign of |¯(x).lgamma_r() is a reentrant interface that performs identically tolgamma(), differing in that the sign of |¯(x) is stored in the location pointed to by thesignargument andsigngamis not modified. Thetgamma(x) andtgammaf(x) functions return |¯(x), with no effect onsigngam.gamma(),gammaf(),gamma_r(), andgammaf_r() are deprecated aliases forlgamma(),lgammaf(),lgamma_r(), andlgammaf_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 afterlgamma() 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-posi- tive integers. For large non-integer negative values,tgamma() will underflow. On the VAX, the reserved operator is returned, anderrnois set to ERANGE.SEE ALSO

math(3)HISTORY

Thelgammafunction appeared in 4.3BSD. Thetgamma() function appeared in NetBSD 6.0. NetBSD 10.0 May 4, 2012 NetBSD 10.0

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.