diff options
author | 2015-07-19 17:31:47 +0000 | |
---|---|---|
committer | 2015-07-19 17:31:47 +0000 | |
commit | 33282fddd45d206cd880101f7a72e00b40aedad9 (patch) | |
tree | bbe2add9fbed62c074b409885c5b6629e1156a08 | |
parent | remove code from unbound's rc script that generates control keys/certs if (diff) | |
download | wireguard-openbsd-33282fddd45d206cd880101f7a72e00b40aedad9.tar.xz wireguard-openbsd-33282fddd45d206cd880101f7a72e00b40aedad9.zip |
Make exponents of x and y signed and fix esx and esy
comparisons. The offending input in gfortran's round_4.f90 was
nextafterl(0.10000000000000000000135525271560688L, -INFINITY) which
caused an ulp addition rather than subtraction.
Reported by John Marino @ DragonFlyBSD.
-rw-r--r-- | lib/libm/src/ld80/s_nextafterl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libm/src/ld80/s_nextafterl.c b/lib/libm/src/ld80/s_nextafterl.c index 0c28b02101e..39de3fa9607 100644 --- a/lib/libm/src/ld80/s_nextafterl.c +++ b/lib/libm/src/ld80/s_nextafterl.c @@ -25,7 +25,8 @@ long double nextafterl(long double x, long double y) { int32_t hx,hy,ix,iy; - u_int32_t lx,ly,esx,esy; + u_int32_t lx,ly; + int32_t esx,esy; GET_LDOUBLE_WORDS(esx,hx,lx,x); GET_LDOUBLE_WORDS(esy,hy,ly,y); @@ -43,8 +44,8 @@ nextafterl(long double x, long double y) u = u * u; /* raise underflow flag */ return x; } - if(esx<0x8000) { /* x > 0 */ - if(ix>iy||((ix==iy) && (hx>hy||((hx==hy)&&(lx>ly))))) { + if(esx>=0) { /* x > 0 */ + if(esx>esy||((esx==esy) && (hx>hy||((hx==hy)&&(lx>ly))))) { /* x > y, x -= ulp */ if(lx==0) { if ((hx&0x7fffffff)==0) esx -= 1; @@ -59,7 +60,7 @@ nextafterl(long double x, long double y) } } } else { /* x < 0 */ - if(esy>=0||(ix>iy||((ix==iy)&&(hx>hy||((hx==hy)&&(lx>ly)))))){ + if(esy>=0||(esx>esy||((esx==esy)&&(hx>hy||((hx==hy)&&(lx>ly)))))){ /* x < y, x -= ulp */ if(lx==0) { if ((hx&0x7fffffff)==0) esx -= 1; |