summary refs log tree commit diff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-27 05:31:37 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-27 05:31:37 +0000
commitf0e3c47fd6879b96d9ce712284e8a349092262dd (patch)
treef26027586e7a72165b1939cb07df890892b367cd /sysdeps/ieee754
parent49768bb93e4960a814563ee30213eaf36e6dcb48 (diff)
downloadglibc-f0e3c47fd6879b96d9ce712284e8a349092262dd.tar.gz
glibc-f0e3c47fd6879b96d9ce712284e8a349092262dd.tar.xz
glibc-f0e3c47fd6879b96d9ce712284e8a349092262dd.zip
* sysdeps/ieee754/dbl-64/s_expm1.c: Set errno for overflow.
	* sysdeps/ieee754/flt-32/s_expm1f.c: Likewise.
	* sysdeps/x86_64/fpu/s_expm1l.S: Likewise.
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/dbl-64/s_expm1.c6
-rw-r--r--sysdeps/ieee754/flt-32/s_expm1f.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_expm1.c b/sysdeps/ieee754/dbl-64/s_expm1.c
index bfd15b2e31..324354336e 100644
--- a/sysdeps/ieee754/dbl-64/s_expm1.c
+++ b/sysdeps/ieee754/dbl-64/s_expm1.c
@@ -112,6 +112,7 @@ static char rcsid[] = "$NetBSD: s_expm1.c,v 1.8 1995/05/10 20:47:09 jtc Exp $";
  * to produce the hexadecimal values shown.
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 #define one Q[0]
@@ -159,7 +160,10 @@ Q[]  =  {1.0, -3.33333333333331316428e-02, /* BFA11111 111110F4 */
 		         return x+x; 	 /* NaN */
 		    else return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */
 	        }
-	        if(x > o_threshold) return huge*huge; /* overflow */
+	        if(x > o_threshold) {
+		  __set_errno (ERANGE);
+		  return huge*huge; /* overflow */
+		}
 	    }
 	    if(xsb!=0) { /* x < -56*ln2, return -1.0 with inexact */
 		if(x+tiny<0.0)		/* raise inexact */
diff --git a/sysdeps/ieee754/flt-32/s_expm1f.c b/sysdeps/ieee754/flt-32/s_expm1f.c
index 1f032be25f..3f4536b906 100644
--- a/sysdeps/ieee754/flt-32/s_expm1f.c
+++ b/sysdeps/ieee754/flt-32/s_expm1f.c
@@ -17,6 +17,7 @@
 static char rcsid[] = "$NetBSD: s_expm1f.c,v 1.5 1995/05/10 20:47:11 jtc Exp $";
 #endif
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 
@@ -63,7 +64,10 @@ Q5  =  -2.0109921195e-07; /* 0xb457edbb */
 		    return x+x; 	 /* NaN */
 		if(hx==0x7f800000)
 		    return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */
-	        if(x > o_threshold) return huge*huge; /* overflow */
+	        if(x > o_threshold) {
+		  __set_errno (ERANGE);
+		  return huge*huge; /* overflow */
+		}
 	    }
 	    if(xsb!=0) { /* x < -27*ln2, return -1.0 with inexact */
 		if(x+tiny<(float)0.0)	/* raise inexact */