summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-96/s_nexttoward.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/s_nexttoward.c')
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttoward.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttoward.c b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
index f7a8b2165a..3d0382eac9 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
@@ -25,6 +25,7 @@ static char rcsid[] = "$NetBSD: $";
* Special cases:
*/
+#include <errno.h>
#include <math.h>
#include <math_private.h>
#include <float.h>
@@ -70,15 +71,14 @@ double __nexttoward(double x, long double y)
}
hy = hx&0x7ff00000;
if(hy>=0x7ff00000) {
- x = x+x; /* overflow */
- if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
- /* Force conversion to double. */
- asm ("" : "+m"(x));
- return x;
+ 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;