about summary refs log tree commit diff
path: root/sysdeps/ieee754/k_standard.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-11-21 19:58:34 +0000
committerUlrich Drepper <drepper@redhat.com>2004-11-21 19:58:34 +0000
commit52495f29a2e8519da83cbda0c21ad95405364705 (patch)
tree1ece157b55f4df330c2cbdc2b6cb276c57959476 /sysdeps/ieee754/k_standard.c
parent250ecb48d516b08be7d0fdba0a7ba5146e148a77 (diff)
downloadglibc-52495f29a2e8519da83cbda0c21ad95405364705.tar.gz
glibc-52495f29a2e8519da83cbda0c21ad95405364705.tar.xz
glibc-52495f29a2e8519da83cbda0c21ad95405364705.zip
[BZ #552]
Update.
2004-11-20  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/ieee754/k_standard.c: Document code 50.
	(__kernel_standard) <case 50>: Avoid raising div-by-zero
	exception again.

2004-11-19  H.J. Lu  <hongjiu.lu@intel.com>

	[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).
Diffstat (limited to 'sysdeps/ieee754/k_standard.c')
-rw-r--r--sysdeps/ieee754/k_standard.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/sysdeps/ieee754/k_standard.c b/sysdeps/ieee754/k_standard.c
index 6def34bc0c..d8fa2a4493 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;
 }