1 /* @(#)w_gamma.c 5.1 93/09/24 */
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
10 * ====================================================
13 /* double gamma(double x)
14 * Return the logarithm of the Gamma function of x or the Gamma function of x,
15 * depending on the library mode.
22 double tgamma(double x
)
30 y
= gamma_r(x
,&local_signgam
);
31 if (local_signgam
< 0) y
= -y
;
35 if(_LIB_VERSION
== _IEEE_
) return y
;
37 if(!finite(y
)&&finite(x
)) {
38 if(floor(x
)==x
&&x
<=0.0)