diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c index 7eca121701..07e9375b78 100644 --- a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c +++ b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c @@ -20,6 +20,7 @@ * Special cases: */ +#include <errno.h> #include <math.h> #include <math_private.h> #include <math_ldbl_opt.h> @@ -62,15 +63,14 @@ float __nldbl_nexttowardf(float x, double y) } hy = hx&0x7f800000; if(hy>=0x7f800000) { - x = x+x; /* overflow */ - if (FLT_EVAL_METHOD != 0) - /* Force conversion to float. */ - asm ("" : "+m"(x)); - return x; + 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; |