aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/math_err.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/math_err.c')
-rw-r--r--sysdeps/ieee754/dbl-64/math_err.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/sysdeps/ieee754/dbl-64/math_err.c b/sysdeps/ieee754/dbl-64/math_err.c
index 4a07fd5..b8c645a 100644
--- a/sysdeps/ieee754/dbl-64/math_err.c
+++ b/sysdeps/ieee754/dbl-64/math_err.c
@@ -29,8 +29,24 @@ with_errno (double y, int e)
errno = e;
return y;
}
+
+NOINLINE static int
+with_errno_i (int y, int e)
+{
+ errno = e;
+ return y;
+}
+
+NOINLINE static long int
+with_errno_li (long int y, int e)
+{
+ errno = e;
+ return y;
+}
#else
#define with_errno(x, e) (x)
+#define with_errno_i(x, e) (x)
+#define with_errno_li(x, e) (x)
#endif
attribute_hidden double
@@ -83,6 +99,22 @@ __math_invalid (double x)
return isnan (x) ? y : with_errno (y, EDOM);
}
+attribute_hidden int
+__math_invalid_i (int r)
+{
+ double y = 0.0 / 0.0;
+ math_force_eval (y);
+ return with_errno_i (r, EDOM);
+}
+
+attribute_hidden long int
+__math_invalid_li (long int r)
+{
+ double y = 0.0 / 0.0;
+ math_force_eval (y);
+ return with_errno_li (r, EDOM);
+}
+
/* Check result and set errno if necessary. */
attribute_hidden double