Mercurial > hg > CbC > CbC_gcc
diff libquadmath/math/lgammaq.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | 561a7518be6b |
children | 1830386684a0 |
line wrap: on
line diff
--- a/libquadmath/math/lgammaq.c Sun Aug 21 07:07:55 2011 +0900 +++ b/libquadmath/math/lgammaq.c Fri Oct 27 22:46:09 2017 +0900 @@ -18,7 +18,7 @@ * Returns the base e (2.718...) logarithm of the absolute * value of the gamma function of the argument. * The sign (+1 or -1) of the gamma function is returned in a - * global (extern) variable named sgngam. + * global (extern) variable named signgam. * * The positive domain is partitioned into numerous segments for approximation. * For x > 10, @@ -70,6 +70,10 @@ #include "quadmath-imp.h" +#ifdef HAVE_MATH_H_SIGNGAM +#include <math.h> /* For POSIX's extern int signgam. */ +#endif + static const __float128 PIQ = 3.1415926535897932384626433832795028841972E0Q; static const __float128 MAXLGM = 1.0485738685148938358098967157129705071571E4928Q; static const __float128 one = 1.0Q; @@ -757,9 +761,12 @@ lgammaq (__float128 x) { __float128 p, q, w, z, nx; - int i, nn, sign; + int i, nn; +#ifndef HAVE_MATH_H_SIGNGAM + int signgam; +#endif - sign = 1; + signgam = 1; if (! finiteq (x)) return x * x; @@ -767,7 +774,7 @@ if (x == 0.0Q) { if (signbitq (x)) - sign = -1; + signgam = -1; } if (x < 0.0Q) @@ -778,9 +785,9 @@ return (one / (p - p)); i = p; if ((i & 1) == 0) - sign = -1; + signgam = -1; else - sign = 1; + signgam = 1; z = q - p; if (z > 0.5Q) { @@ -789,7 +796,7 @@ } z = q * sinq (PIQ * z); if (z == 0.0Q) - return (sign * huge * huge); + return (signgam * huge * huge); w = lgammaq (q); z = logq (PIQ / z) - w; return (z); @@ -855,7 +862,7 @@ { z = x - 0.75Q; p = z * neval (z, RN1r75, NRN1r75) - / deval (z, RD1r75, NRD1r75); + / deval (z, RD1r75, NRD1r75); p += lgam1r75b; p += lgam1r75a; } @@ -1021,7 +1028,7 @@ } if (x > MAXLGM) - return (sign * huge * huge); + return (signgam * huge * huge); q = ls2pi - x; q = (x - 0.5Q) * logq (x) + q;