summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-10-09 19:34:06 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-10-09 19:34:06 +0200
commit6772d640a4f4874166a61f1859e1660a2913a89d (patch)
tree839fea4d5dcefab75577cecb563ccad4234eb953 /sysdeps/ieee754/ldbl-96/s_nexttowardf.c
parentf98906bbb57cb495b4501afc5f18604ef3a94e2a (diff)
parent7bb5f8a836b916d6ebf7b6921b136e99cea2442d (diff)
Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixes
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/s_nexttowardf.c')
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttowardf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
index a96f9da2c2..ae7538942f 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
@@ -17,6 +17,7 @@
static char rcsid[] = "$NetBSD: $";
#endif
+#include <errno.h>
#include <math.h>
#include <math_private.h>
#include <float.h>
@@ -58,15 +59,14 @@ float __nexttowardf(float x, long 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;