2 /* @(#)wr_lgamma.c 5.1 93/09/24 */
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7 * Developed at SunPro, a Sun Microsystems, Inc. business.
8 * Permission to use, copy, modify, and distribute this
9 * software is freely granted, provided that this notice
11 * ====================================================
15 * wrapper double lgamma_r(double x, int *signgamp)
21 #ifndef _DOUBLE_IS_32BITS
24 double lgamma_r(double x
, int *signgamp
) /* wrapper lgamma_r */
26 double lgamma_r(x
,signgamp
) /* wrapper lgamma_r */
27 double x
; int *signgamp
;
31 return __ieee754_lgamma_r(x
,signgamp
);
35 y
= __ieee754_lgamma_r(x
,signgamp
);
36 if(_LIB_VERSION
== _IEEE_
) return y
;
37 if(!finite(y
)&&finite(x
)) {
42 SET_HIGH_WORD(inf
,0x7ff00000); /* set inf to infinite */
46 exc
.arg1
= exc
.arg2
= (double)x
;
47 if (_LIB_VERSION
== _SVID_
)
50 exc
.retval
= HUGE_VAL
;
51 if(floor(x
)==x
&&x
<=0.0) {
52 /* lgamma(-integer) */
54 if (_LIB_VERSION
== _POSIX_
)
56 else if (!matherr(&exc
)) {
61 /* lgamma(finite) overflow */
63 if (_LIB_VERSION
== _POSIX_
)
65 else if (!matherr(&exc
)) {
77 #endif /* defined(_DOUBLE_IS_32BITS) */