summaryrefslogtreecommitdiff
path: root/math/s_nextafter.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-04-16 23:59:09 +0000
committerJakub Jelinek <jakub@redhat.com>2007-04-16 23:59:09 +0000
commite220c524c93b053a1dea504a2d18288ff8f32b9a (patch)
tree4193293c838a7db46f2cc0c2b50cb8601dcddb8d /math/s_nextafter.c
parenta891c7b0e014df5df027249f59cb444b87afdf30 (diff)
Updated to fedora-glibc-20070416T2350cvs/fedora-glibc-2_5_90-21
Diffstat (limited to 'math/s_nextafter.c')
-rw-r--r--math/s_nextafter.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/math/s_nextafter.c b/math/s_nextafter.c
index 9c678b79c5..d2af52dda3 100644
--- a/math/s_nextafter.c
+++ b/math/s_nextafter.c
@@ -26,7 +26,7 @@ static char rcsid[] = "$NetBSD: s_nextafter.c,v 1.8 1995/05/10 20:47:58 jtc Exp
#define nexttoward __internal_nexttoward
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#include <float.h>
#ifdef __STDC__
@@ -49,9 +49,12 @@ static char rcsid[] = "$NetBSD: s_nextafter.c,v 1.8 1995/05/10 20:47:58 jtc Exp
return x+y;
if(x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
+ double u;
INSERT_WORDS(x,hy&0x80000000,1); /* return +-minsubnormal */
- y = x*x;
- if(y==x) return y; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u*u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(hx>hy||((hx==hy)&&(lx>ly))) { /* x > y, x -= ulp */
@@ -74,15 +77,12 @@ static char rcsid[] = "$NetBSD: s_nextafter.c,v 1.8 1995/05/10 20:47:58 jtc Exp
if(hy>=0x7ff00000) {
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
- asm ("" : "=m"(x) : "m"(x));
+ asm ("" : "+m"(x));
return x; /* overflow */
}
- if(hy<0x00100000) { /* underflow */
- y = x*x;
- if(y!=x) { /* raise underflow flag */
- INSERT_WORDS(y,hx,lx);
- return y;
- }
+ if(hy<0x00100000) {
+ double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
INSERT_WORDS(x,hx,lx);
return x;