From 7cb029ee6ec74801aebe41af62d20a44775d0697 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 1 May 2012 15:37:43 +0000 Subject: Fix nexttoward bugs (bugs 2550, 2570). --- sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c') diff --git a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c index 68027f26fa..7eca121701 100644 --- a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c +++ b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c @@ -50,16 +50,12 @@ float __nldbl_nexttowardf(float x, 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; -- cgit 1.4.1