Move nss_compat from nis to nss subdir and install it unconditionally
[glibc.git] / math / w_lgamma_main.c
blob7dbba22f4efe70f55fa039518e94e707668cb719
1 /* @(#)w_lgamma.c 5.1 93/09/24 */
2 /*
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
9 * is preserved.
10 * ====================================================
13 /* double lgamma(double x)
14 * Return the logarithm of the Gamma function of x.
16 * Method: call __ieee754_lgamma_r
19 #include <math.h>
20 #include <math_private.h>
21 #include <math-svid-compat.h>
23 #include <lgamma-compat.h>
25 #if BUILD_LGAMMA
26 double
27 LGFUNC (__lgamma) (double x)
29 double y = CALL_LGAMMA (double, __ieee754_lgamma_r, x);
30 if(__builtin_expect(!isfinite(y), 0)
31 && isfinite(x) && _LIB_VERSION != _IEEE_)
32 return __kernel_standard(x, x,
33 __floor(x)==x&&x<=0.0
34 ? 15 /* lgamma pole */
35 : 14); /* lgamma overflow */
37 return y;
39 # if USE_AS_COMPAT
40 compat_symbol (libm, __lgamma_compat, lgamma, LGAMMA_OLD_VER);
41 # ifdef NO_LONG_DOUBLE
42 strong_alias (__lgamma_compat, __lgammal_compat)
43 compat_symbol (libm, __lgammal_compat, lgammal, LGAMMA_OLD_VER);
44 # endif
45 # else
46 versioned_symbol (libm, __lgamma, lgamma, LGAMMA_NEW_VER);
47 # ifdef NO_LONG_DOUBLE
48 strong_alias (__lgamma, __lgammal)
49 versioned_symbol (libm, __lgammal, lgammal, LGAMMA_NEW_VER);
50 # endif
51 # endif
52 # if GAMMA_ALIAS
53 strong_alias (LGFUNC (__lgamma), __gamma)
54 weak_alias (__gamma, gamma)
55 # ifdef NO_LONG_DOUBLE
56 strong_alias (__gamma, __gammal)
57 weak_alias (__gamma, gammal)
58 # endif
59 # endif
60 #endif