X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fnextafterl.c;h=aec8ab4048993eba11b1939fe32f823859b118a9;hb=0a036507374004156ba6dfd5db9d0c8efa70e78a;hp=152204255764590090db6e0b42f1b59aab2cb9ac;hpb=fc04675a09587031d5daebcb877b73976890b71d;p=libm diff --git a/src/math/nextafterl.c b/src/math/nextafterl.c index 1522042..aec8ab4 100644 --- a/src/math/nextafterl.c +++ b/src/math/nextafterl.c @@ -18,12 +18,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double nextafterl(long double x, long double y) { return nextafter(x, y); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 long double nextafterl(long double x, long double y) { volatile long double t; @@ -51,16 +51,16 @@ long double nextafterl(long double x, long double y) if(x > 0.0 ^ x < y) { /* x -= ulp */ if (ux.bits.manl == 0) { if ((ux.bits.manh&~LDBL_NBIT) == 0) - ux.bits.exp -= 1; + ux.bits.exp--; ux.bits.manh = (ux.bits.manh - 1) | (ux.bits.manh & LDBL_NBIT); } - ux.bits.manl -= 1; + ux.bits.manl--; } else { /* x += ulp */ - ux.bits.manl += 1; + ux.bits.manl++; if (ux.bits.manl == 0) { ux.bits.manh = (ux.bits.manh + 1) | (ux.bits.manh & LDBL_NBIT); if ((ux.bits.manh&~LDBL_NBIT)==0) - ux.bits.exp += 1; + ux.bits.exp++; } } if (ux.bits.exp == 0x7fff) /* overflow */