about summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32/s_nextafterf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_nextafterf.c')
-rw-r--r--sysdeps/ieee754/flt-32/s_nextafterf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/ieee754/flt-32/s_nextafterf.c b/sysdeps/ieee754/flt-32/s_nextafterf.c
index 22e0b3d4ed..625d54b768 100644
--- a/sysdeps/ieee754/flt-32/s_nextafterf.c
+++ b/sysdeps/ieee754/flt-32/s_nextafterf.c
@@ -17,6 +17,7 @@
 static char rcsid[] = "$NetBSD: s_nextafterf.c,v 1.4 1995/05/10 20:48:01 jtc Exp $";
 #endif
 
+#include <errno.h>
 #include <math.h>
 #include <math_private.h>
 #include <float.h>
@@ -59,10 +60,12 @@ float __nextafterf(float x, float y)
 	if(hy>=0x7f800000) {
 	  float u = x+x;	/* overflow  */
 	  math_force_eval (u);
+	  __set_errno (ERANGE);
 	}
 	if(hy<0x00800000) {
 	    float u = x*x;			/* underflow */
 	    math_force_eval (u);		/* raise underflow flag */
+	    __set_errno (ERANGE);
 	}
 	SET_FLOAT_WORD(x,hx);
 	return x;