Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

gamma_r(3) Guardian Native C Library Calls Reference Manual
NAME
gamma_r - Computes the logarithm of the gamma function (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes that do not use Standard POSIX Threads:
/G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes that do not use Standard POSIX Threads:
/G/system/zdllnnn/ycredll
H-series and J-series OSS processes that use the Standard POSIX Threads library:
/G/system/zdllnnn/zsptdll
SYNOPSIS
#include <math.h> | #include <spthread.h>
/* math.h is required for H-series and J-series processes that do not use */
/* the Standard POSIX Threads library */
/* spthread.h is required for G-series native OSS processes, and for H-series */
/* and J-series OSS processes that use the Standard POSIX Threads library */
double gamma_r(
double x,
int *signgamp);
extern int signgam;
PARAMETERS
x Species a positive double value.
signgamp Points to the sign of the gamma function.
DESCRIPTION
The gamma_r() function is the reentrant version of the gamma() function.
The gamma_r() 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
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 gamma_r() function.
The x parameter cannot be a nonpositive integer. The gamma of x is defined 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 of gamma_r().
The gamma( ) function, available for IEEE Std 754-1985 floating-point values on H-series and J-
series native processes, can be used to calculate the true gamma function. Or, use the express-
sion:
g = signgamp * exp(gamma_r(x,*signgamp));
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. For a description of IEEE value classes, see the fp_class(3)
34 Hewlett-Packard Company 527192-018