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#include <lgamma-compat.h>
27
28#if BUILD_LGAMMA
29long double
30LGFUNC (__lgammal) (long double x)
31{
32 long double y = CALL_LGAMMA (long double, __ieee754_lgammal_r, x);
33 if(__builtin_expect(!isfinite(y), 0)
34 && isfinite(x) && _LIB_VERSION != _IEEE_)
35 return __kernel_standard_l(x, x,
36 __floorl(x)==x&&x<=0.0L
37 ? 215 /* lgamma pole */
38 : 214); /* lgamma overflow */
39
40 return y;
41}
42# if USE_AS_COMPAT
43compat_symbol (libm, __lgammal_compat, lgammal, LGAMMA_OLD_VER);
44# else
45versioned_symbol (libm, __lgammal, lgammal, LGAMMA_NEW_VER);
46# endif
47# if GAMMA_ALIAS
48strong_alias (LGFUNC (__lgammal), __gammal)
49weak_alias (__gammal, gammal)
50# endif
51#endif
52