* inet/getrpcbynumber.c (BUFLEN): New macro.
[glibc.git] / sysdeps / libm-ieee754 / w_lgammal.c
blob3d2cdbbc30cb2dca270230afac78b492d113cbe0
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 */
6 /*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
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 * ====================================================
17 #if defined(LIBM_SCCS) && !defined(lint)
18 static char rcsid[] = "$NetBSD: $";
19 #endif
21 /* long double lgammal(long double x)
22 * Return the logarithm of the Gamma function of x.
24 * Method: call __ieee754_lgammal_r
27 #include "math.h"
28 #include "math_private.h"
30 extern int signgam;
32 #ifdef __STDC__
33 long double __lgammal(long double x)
34 #else
35 long double __lgammal(x)
36 long double x;
37 #endif
39 #ifdef _IEEE_LIBM
40 return __ieee754_lgammal_r(x,&signgam);
41 #else
42 long double y;
43 y = __ieee754_lgammal_r(x,&signgam);
44 if(_LIB_VERSION == _IEEE_) return y;
45 if(!__finitel(y)&&__finitel(x)) {
46 if(__floorl(x)==x&&x<=0.0)
47 return __kernel_standard(x,x,215); /* lgamma pole */
48 else
49 return __kernel_standard(x,x,214); /* lgamma overflow */
50 } else
51 return y;
52 #endif
54 weak_alias (__lgammal, lgammal)