about summary refs log tree commit diff
path: root/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/m68k/m680x0/fpu/s_nextafterl.c')
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_nextafterl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/m68k/m680x0/fpu/s_nextafterl.c b/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
index ad77ca4f67..c46c0e76ec 100644
--- a/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
+++ b/sysdeps/m68k/m680x0/fpu/s_nextafterl.c
@@ -26,6 +26,7 @@ static char rcsid[] = "$NetBSD: $";
  *   Special cases:
  */
 
+#include <errno.h>
 #include <math.h>
 #include <math_private.h>
 
@@ -92,10 +93,12 @@ long double __nextafterl(long double x, long double y)
 	if(esy==0x7fff) {
 	    long double u = x + x;	/* overflow  */
 	    math_force_eval (u);
+	    __set_errno (ERANGE);
 	}
 	if(esy==0 && (hx & 0x80000000) == 0) { /* underflow */
 	    y = x*x;
 	    math_force_eval (y);		/* raise underflow flag */
+	    __set_errno (ERANGE);
 	}
 	SET_LDOUBLE_WORDS(x,esx,hx,lx);
 	return x;