Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
lgammal(3) OSS Library Calls Reference Manual
NAME
lgammal - Computes the logarithm of the gamma function for a long double value
LIBRARY
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <math.h>
long double lgammal(
long double x);
extern int signgam;
PARAMETERS
x Specifies a positive long double value.
DESCRIPTION
The lgammal( ) function is a long double version of the lgamma() function; it takes a long dou-
ble argument and returns a long double result.
The lgammal( ) function returns the logarithm of the absolute value of the gamma of x, where the
gamma of x is defined as:
0
∫
∞
e
−t
t
x−1
dt
The sign of the gamma of x is stored in the external integer variable signgam. The x parameter
cannot be a nonpositive integer. The gamma of x is defined over the real numbers, except for the
nonpositive integers.
NOTES
Do not use the expression
g = signgam * exp (lgammal (x))
to compute
g = lgammal (x)
Instead, use the following sequence:
lg = lgammal (x);
g = signgam * exp (lg);
This is because the C language does not specify evaluation order, and signgam is modified by
the call to the lgammal( ) function.
The names lgamma( ) and gamma( ) are different names for the same function. The gamma( )
function is provided for compatibility with older versions of UNIX. The lgamma(), lgammaf( ),
and lgammal( ) functions should be used instead.
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values
in the native environment. IEEE values can include NaN and infinity, and the sign of 0.0 (zero)
can be either positive or negative. Refer to the fp_class(3) reference page for a description of
IEEE value classes.
Guardian functions are available to convert between floating-point formats. Refer to the Guar-
dian Programmer’s Guide for a discussion of floating-point conversions.
4−96 Hewlett-Packard Company 527187-017