summaryrefslogtreecommitdiff
path: root/sysdeps/i386/fpu/s_nextafterl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/fpu/s_nextafterl.c')
-rw-r--r--sysdeps/i386/fpu/s_nextafterl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sysdeps/i386/fpu/s_nextafterl.c b/sysdeps/i386/fpu/s_nextafterl.c
index 188dc2129a..d6e3025bb2 100644
--- a/sysdeps/i386/fpu/s_nextafterl.c
+++ b/sysdeps/i386/fpu/s_nextafterl.c
@@ -28,12 +28,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __nextafterl(long double x, long double y)
{
- u_int32_t hx,hy,ix,iy;
- u_int32_t lx,ly;
+ uint32_t hx,hy,ix,iy;
+ uint32_t lx,ly;
int32_t esx,esy;
GET_LDOUBLE_WORDS(esx,hx,lx,x);
@@ -86,7 +88,7 @@ long double __nextafterl(long double x, long double y)
if(esy>=0||(esx>esy||((esx==esy)&&(hx>hy||((hx==hy)&&(lx>ly)))))){
/* x < y, x -= ulp */
if(lx==0) {
- if (hx <= 0x80000000) {
+ if (hx <= 0x80000000 && esx != 0xffff8000) {
esx -= 1;
hx = hx - 1;
if ((esx&0x7fff) > 0)
@@ -120,6 +122,6 @@ long double __nextafterl(long double x, long double y)
SET_LDOUBLE_WORDS(x,esx,hx,lx);
return x;
}
-weak_alias (__nextafterl, nextafterl)
+libm_alias_ldouble (__nextafter, nextafter)
strong_alias (__nextafterl, __nexttowardl)
weak_alias (__nextafterl, nexttowardl)