HP-UX Reference (11i v3 07/02) - 3 Library Functions A-M (vol 6)
l
lgamma(3M) lgamma(3M)
lgammaq(), gammaq(), and lgammaq_r are equivalent to
lgammal(), gammal(), and
lgammal_r() respectively on HP-UX systems.
USAGE
To use these functions, compile either with the default
-Ae option or with the -Aa and
-D_HPUX_SOURCE
options.
To use (for Integrity servers)
lgammaw()
, lgammaw_r() , gammaw(), lgammaq() , lgammaq_r() ,
or
gammaq(), compile also with the
-fpwidetypes option.
Make sure your program includes
<math.h>, and link in the math library by specifying
-lm on the com-
piler or linker command line.
For more information, see the HP-UX floating-point guide for HP Integrity servers at the following site:
http://www.hp.com/go/fp
.
RETURN VALUE
lgamma(1) returns +0.
lgamma(2) returns +0.
lgamma(x) returns +Inf and raises the divide-by- zero floating-point exception for x a negative integer or
zero.
lgamma(-Inf) returns +Inf.
lgamma(+Inf) returns +Inf.
If x is NaN, lgamma() and gamma() return NaN.
lgamma() returns infinity (equal to HUGE_VAL) in lieu of a value whose magnitude is too large, and
raises the overflow and inexact exceptions.
When it raises no other exception, whether lgamma() raises the inexact exception is unspecified.
WARNINGS
lgamma() and gamma() are unsafe in multi-thread applications.
lgamma_r() is MT-Safe and should
be used instead.
SEE ALSO
exp(3M), log(3M), tgamma(3M), math(5).
STANDARDS CONFORMANCE
lgamma() : SVID3, XPG4.2, ISO/IEC C99 (including Annex F, "IEC 60559 floating-point arithmetic")
gamma() : SVID3, XPG4.2
lgammaf(), lgammal() : ISO/IEC C99 (including Annex F, ‘‘IEC 60559 floating-point arithmetic’’)
718 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: February 2007