Don't disable CMPLXL macro for __NO_LONG_DOUBLE_MATH (bug 15488).
[platform/upstream/glibc.git] / math / w_lgammal.c
1 /* w_lgammal.c -- long double version of w_lgamma.c.
2  * Conversion to long double by Ulrich Drepper,
3  * Cygnus Support, drepper@cygnus.com.
4  */
5
6 /*
7  * ====================================================
8  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9  *
10  * Developed at SunPro, a Sun Microsystems, Inc. business.
11  * Permission to use, copy, modify, and distribute this
12  * software is freely granted, provided that this notice
13  * is preserved.
14  * ====================================================
15  */
16
17 /* long double lgammal(long double x)
18  * Return the logarithm of the Gamma function of x.
19  *
20  * Method: call __ieee754_lgammal_r
21  */
22
23 #include <math.h>
24 #include <math_private.h>
25
26 long double
27 __lgammal(long double x)
28 {
29         int local_signgam = 0;
30         long double y = __ieee754_lgammal_r(x,
31                                             _LIB_VERSION != _ISOC_
32                                             /* ISO C99 does not define the
33                                                global variable.  */
34                                             ? &signgam
35                                             : &local_signgam);
36         if(__builtin_expect(!__finitel(y), 0)
37            && __finitel(x) && _LIB_VERSION != _IEEE_)
38                 return __kernel_standard_l(x, x,
39                                            __floorl(x)==x&&x<=0.0L
40                                            ? 215 /* lgamma pole */
41                                            : 214); /* lgamma overflow */
42
43         return y;
44 }
45 weak_alias (__lgammal, lgammal)
46 strong_alias (__lgammal, __gammal)
47 weak_alias (__gammal, gammal)