From 52495f29a2e8519da83cbda0c21ad95405364705 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 21 Nov 2004 19:58:34 +0000 Subject: [BZ #552] Update. 2004-11-20 Jakub Jelinek * sysdeps/ieee754/k_standard.c: Document code 50. (__kernel_standard) : Avoid raising div-by-zero exception again. 2004-11-19 H.J. Lu [BZ #552] * math/libm-test.inc (tgamma_test): Update tgamma (0) and tgamma (-0). * sysdeps/generic/w_tgamma.c (__tgamma): Properly handle |x| == 0. * sysdeps/generic/w_tgammaf.c (__tgammaf): Likewise. * sysdeps/generic/w_tgammal.c (__tgammal): Likewise. * sysdeps/ieee754/dbl-64/e_gamma_r.c (__ieee754_gamma_r): Likewise. * sysdeps/ieee754/flt-32/e_gammaf_r.c: Likewise. * sysdeps/ieee754/ldbl-128/e_gammal_r.c: Likewise. * sysdeps/ieee754/ldbl-96/e_gammal_r.c: Likewise. * sysdeps/ieee754/k_standard.c (__kernel_standard): Handle tgamma (0) and tgamma (-0). --- sysdeps/ieee754/k_standard.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'sysdeps/ieee754/k_standard.c') diff --git a/sysdeps/ieee754/k_standard.c b/sysdeps/ieee754/k_standard.c index 6def34b..d8fa2a4 100644 --- a/sysdeps/ieee754/k_standard.c +++ b/sysdeps/ieee754/k_standard.c @@ -90,6 +90,7 @@ static double zero = 0.0; /* used as const */ * 47-- exp10 underflow * 48-- log2(0) * 49-- log2(x<0) + * 50-- tgamma(+-0) */ @@ -832,7 +833,7 @@ static double zero = 0.0; /* used as const */ case 40: case 140: case 240: - /* gamma(finite) overflow */ + /* tgamma(finite) overflow */ exc.type = OVERFLOW; exc.name = type < 100 ? "tgamma" : (type < 200 ? "tgammaf" : "tgammal"); @@ -846,7 +847,7 @@ static double zero = 0.0; /* used as const */ case 41: case 141: case 241: - /* gamma(-integer) or gamma(0) */ + /* tgamma(-integer) */ exc.type = SING; exc.name = type < 100 ? "tgamma" : (type < 200 ? "tgammaf" : "tgammal"); @@ -973,8 +974,24 @@ static double zero = 0.0; /* used as const */ __set_errno (EDOM); } break; + case 50: + case 150: + case 250: + /* tgamma(+-0) */ + exc.type = SING; + exc.name = type < 100 ? "tgamma" : (type < 200 + ? "tgammaf" : "tgammal"); + exc.retval = __copysign (HUGE_VAL, x); + if (_LIB_VERSION == _POSIX_) + __set_errno (ERANGE); + else if (!matherr(&exc)) { + if (_LIB_VERSION == _SVID_) + (void) WRITE2("tgamma: SING error\n", 18); + __set_errno (ERANGE); + } + break; - /* #### Last used is 49/149/249 ### */ + /* #### Last used is 50/150/250 ### */ } return exc.retval; } -- cgit v1.1