Open System Services System Calls Reference Manual (G06.28+, H06.05+)

lgamma_r(2) OSS System Calls Reference Manual
NAME
lgamma_r - Computes the logarithm of the gamma function (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <math.h>]
#include <spthread.h>
double lgamma_r (
double x,
int *signgamp );
extern int signgam;
PARAMETERS
x Species a positive double value.
signgamp Points to the sign of the lgamma_r() function.
DESCRIPTION
The lgamma_r() function is the reentrant version of the lgamma() function.
The lgamma_r() function returns the logarithm of the absolute value of the gamma of x, where
the gamma of x is dened as:
0
e
t
t
x1
dt
The sign of the gamma of x is stored in the external integer variable signgam. The value of
signgamp is updated with the value of signgam for the sign of the lgamma_r() function.
The x parameter cannot be a nonpositive integer. The gamma of x is dened over the real
numbers, except for the nonpositive integers.
NOTES
The names lgamma_r() and gamma_r() are different names for the same function. The
gamma_r() function is provided for compatibility with older versions of UNIX. Use the
lgamma_r() function instead.
To compute gamma, use the expression:
g = signgamp * exp(lgamma_r(x,*signgamp));
This function supports both IEEE Std 754-1985 oating-point and Tandem oating-point values
in the native environment. IEEE values can include NaN and innity, and the sign of 0.0 (zero)
can be either positive or negative. For a description of IEEE value classes, refer to the
fp_class(3) reference page.
Guardian functions are available to convert between oating-point formats. For a discussion of
oating-point conversions, refer to the Guardian Programmer’s Guide.
RETURN VALUES
Upon successful completion, the lgamma_r() function returns the logarithmic gamma of x.
For IEEE oating-point values, if the value of x is NaN, NaN is returned. If the value of x is
positive innity, NaN is returned. If the value of x is negative innity, HUGE_VAL is returned
and errno is set to [EDOM].
If the value of x is 0.0 (zero), HUGE_VAL is returned and errno is set to [EDOM]. If the value
of x is a nonpositive integer, HUGE_VAL is returned and errno is set to [EDOM].
414 Hewlett-Packard Company 527186-007