diff options
Diffstat (limited to 'sysdeps/i386/fpu/s_nexttoward.c')
-rw-r--r-- | sysdeps/i386/fpu/s_nexttoward.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/i386/fpu/s_nexttoward.c b/sysdeps/i386/fpu/s_nexttoward.c index 839efe6..0b47044 100644 --- a/sysdeps/i386/fpu/s_nexttoward.c +++ b/sysdeps/i386/fpu/s_nexttoward.c @@ -26,6 +26,7 @@ static char rcsid[] = "$NetBSD: $"; * Special cases: */ +#include <errno.h> #include <math.h> #include <math_private.h> #include <float.h> @@ -75,10 +76,12 @@ double __nexttoward(double x, long double y) if(hy>=0x7ff00000) { double u = x+x; /* overflow */ math_force_eval (u); + __set_errno (ERANGE); } if(hy<0x00100000) { double u = x*x; /* underflow */ math_force_eval (u); /* raise underflow flag */ + __set_errno (ERANGE); } INSERT_WORDS(x,hx,lx); return x; |