aboutsummaryrefslogtreecommitdiff
path: root/math/s_nexttowardf.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-05-01 15:37:43 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-05-01 15:37:43 +0000
commit7cb029ee6ec74801aebe41af62d20a44775d0697 (patch)
tree68ee5f5b88832c10bc1c7560cc9f1651104aebf0 /math/s_nexttowardf.c
parent412bd96612ff5422befb98e990b66d10c26a4b21 (diff)
downloadglibc-7cb029ee6ec74801aebe41af62d20a44775d0697.tar
glibc-7cb029ee6ec74801aebe41af62d20a44775d0697.tar.gz
glibc-7cb029ee6ec74801aebe41af62d20a44775d0697.tar.bz2
glibc-7cb029ee6ec74801aebe41af62d20a44775d0697.zip
Fix nexttoward bugs (bugs 2550, 2570).
Diffstat (limited to 'math/s_nexttowardf.c')
-rw-r--r--math/s_nexttowardf.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/math/s_nexttowardf.c b/math/s_nexttowardf.c
index fb008d579c..e8c4dd1d8d 100644
--- a/math/s_nexttowardf.c
+++ b/math/s_nexttowardf.c
@@ -47,16 +47,12 @@ float __nexttowardf(float x, long double y)
return x;
}
if(hx>=0) { /* x > 0 */
- if(hy<0||(ix>>23)>(iy>>20)-0x380
- || ((ix>>23)==(iy>>20)-0x380
- && (ix&0x7fffff)>(((hy<<3)|(ly>>29))&0x7fffff))) /* x > y, x -= ulp */
+ if(x > y) /* x -= ulp */
hx -= 1;
else /* x < y, x += ulp */
hx += 1;
} else { /* x < 0 */
- if(hy>=0||(ix>>23)>(iy>>20)-0x380
- || ((ix>>23)==(iy>>20)-0x380
- && (ix&0x7fffff)>(((hy<<3)|(ly>>29))&0x7fffff))) /* x < y, x -= ulp */
+ if(x < y) /* x -= ulp */
hx -= 1;
else /* x > y, x += ulp */
hx += 1;