math: raise invalid flag in ilogb*.c on +-0, +-inf and nan
[musl] / src / math / tgamma.c
1 #include <math.h>
2
3 // FIXME: use lanczos approximation
4
5 double __lgamma_r(double, int *);
6
7 double tgamma(double x)
8 {
9         int sign;
10         double y;
11
12         y = exp(__lgamma_r(x, &sign));
13         if (sign < 0)
14                 y = -y;
15         return y;
16 }