mirror of git://sourceware.org/git/glibc.git
Fix nexttoward bugs
[BZ #2550] [BZ #2570] * sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c: Use floating-point comparisons to determine direction to adjust input.
This commit is contained in:
parent
f5a01ca927
commit
4f9d04aa8f
|
|
@ -1,3 +1,10 @@
|
||||||
|
2012-05-02 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
||||||
|
|
||||||
|
[BZ #2550]
|
||||||
|
[BZ #2570]
|
||||||
|
* sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c: Use floating-point
|
||||||
|
comparisons to determine direction to adjust input.
|
||||||
|
|
||||||
2012-05-01 Roland McGrath <roland@hack.frob.com>
|
2012-05-01 Roland McGrath <roland@hack.frob.com>
|
||||||
|
|
||||||
* elf/Makefile ($(objpfx)check-localplt.out): Redirect the test's
|
* elf/Makefile ($(objpfx)check-localplt.out): Redirect the test's
|
||||||
|
|
|
||||||
|
|
@ -57,11 +57,7 @@ double __nexttoward(double x, long double y)
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
if(hx>=0) { /* x > 0 */
|
if(hx>=0) { /* x > 0 */
|
||||||
if (hy<0||(ix>>20)>(iy>>52)
|
if (x > y) { /* x > 0 */
|
||||||
|| ((ix>>20)==(iy>>52)
|
|
||||||
&& (((((int64_t)hx)<<32)|(lx))>(hy&0x000fffffffffffffLL)
|
|
||||||
|| (((((int64_t)hx)<<32)|(lx))==(hy&0x000fffffffffffffLL)
|
|
||||||
)))) { /* x > y, x -= ulp */
|
|
||||||
if(lx==0) hx -= 1;
|
if(lx==0) hx -= 1;
|
||||||
lx -= 1;
|
lx -= 1;
|
||||||
} else { /* x < y, x += ulp */
|
} else { /* x < y, x += ulp */
|
||||||
|
|
@ -69,11 +65,7 @@ double __nexttoward(double x, long double y)
|
||||||
if(lx==0) hx += 1;
|
if(lx==0) hx += 1;
|
||||||
}
|
}
|
||||||
} else { /* x < 0 */
|
} else { /* x < 0 */
|
||||||
if (hy>=0||(ix>>20)>(iy>>52)
|
if (x < y) { /* x < 0 */
|
||||||
|| ((ix>>20)==(iy>>52)
|
|
||||||
&& (((((int64_t)hx)<<32)|(lx))>(hy&0x000fffffffffffffLL)
|
|
||||||
|| (((((int64_t)hx)<<32)|(lx))==(hy&0x000fffffffffffffLL)
|
|
||||||
)))) { /* x < y, x -= ulp */
|
|
||||||
if(lx==0) hx -= 1;
|
if(lx==0) hx -= 1;
|
||||||
lx -= 1;
|
lx -= 1;
|
||||||
} else { /* x > y, x += ulp */
|
} else { /* x > y, x += ulp */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue