]>
Commit | Line | Data |
---|---|---|
e852e889 UD |
1 | /* w_gammal.c -- long double version of w_gamma.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 | ||
e852e889 UD |
17 | /* long double gammal(double x) |
18 | * Return the Gamma function of x. | |
19 | */ | |
20 | ||
9d13fb24 | 21 | #include <math.h> |
9277c064 | 22 | #include <math_private.h> |
e852e889 | 23 | |
0ac5ae23 UD |
24 | long double |
25 | __tgammal(long double x) | |
e852e889 | 26 | { |
e852e889 | 27 | int local_signgam; |
0ac5ae23 | 28 | long double y = __ieee754_gammal_r(x,&local_signgam); |
e852e889 | 29 | |
0ac5ae23 UD |
30 | if(__builtin_expect(!__finitel(y), 0) && __finitel(x) |
31 | && _LIB_VERSION != _IEEE_) { | |
52495f29 UD |
32 | if(x==0.0) |
33 | return __kernel_standard(x,x,250); /* tgamma pole */ | |
0ac5ae23 | 34 | else if(__floorl(x)==x&&x<0.0L) |
52495f29 | 35 | return __kernel_standard(x,x,241); /* tgamma domain */ |
e852e889 UD |
36 | else |
37 | return __kernel_standard(x,x,240); /* tgamma overflow */ | |
38 | } | |
0ac5ae23 | 39 | return local_signgam < 0 ? - y : y; |
e852e889 UD |
40 | } |
41 | weak_alias (__tgammal, tgammal) |