diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c b/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c index 8c61198..d8f4fc6 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c @@ -25,6 +25,7 @@ static char rcsid[] = "$NetBSD: $"; * Special cases: */ +#include <errno.h> #include <math.h> #include <math_private.h> #include <math_ldbl_opt.h> @@ -76,10 +77,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; |