Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (g - i) gamma_r(3)
reference page.
Guardian functions are available to convert between floating-point formats. For a discussion of
floating-point conversions, see the Guardian Programmer’s Guide.
On systems running H06.21 or later H-series RVUs or J06.10 or later J-series RVUs, you can use
either the POSIX User Thread Model library or the Standard POSIX Threads library for threaded
applications.
If you are NOT using the Standard POSIX Threads library (this is not a threaded application or
you are using the POSIX User Thread Model library), you must:
• Include the math.h file
To use the Standard POSIX Threads library, you must:
• Include the spthread.h file
• Link your application to the Standard POSIX Threads library:
/G/system/sysnn/zsptsrl (G-series)
or
/G/system/zdllnnn/zsptdll (H-series or J-series)
• Compile your application using the #define_SPT_MODEL_ macro or an equivalent
compiler command option.
For more detailed information about writing multi-threaded or 64- bit applications for the Open
System Services environment, see the Open System Services Programmer’s Guide.
RETURN VALUES
Upon successful completion, the gamma_r() function returns the logarithmic gamma of x.
For IEEE floating-point values, if the value of x is NaN, NaN is returned. If the value of x is
positive infinity, NaN is returned. If the value of x is negative infinity, 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].
If the correct value would cause overflow, HUGE_VAL is returned.
If the correct value would cause underflow, 0.0 (zero) is returned.
ERRORS
If this condition occurs, the gamma_r() function sets errno to the corresponding value:
[EDOM] The value of x is 0.0, (zero), a nonpositive integer, or negative infinity.
RELATED INFORMATION
Functions: exp(3), fp_class(3), gamma(3), isnan(3), lgamma(3), lgamma_r(3).
STANDARDS CONFORMANCE
Interfaces documented on this reference page conform to the following industry standards:
• IEEE Std 1003.1-2004, POSIX System Application Program Interface
The use of the header file spthread.h is an HP exception to the POSIX standard.
527192-018 Hewlett-Packard Company 3−5