summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-96
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-96')
-rw-r--r--sysdeps/ieee754/ldbl-96/s_cosl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_sinl.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_cosl.c b/sysdeps/ieee754/ldbl-96/s_cosl.c
index 9765f7fd4e..e33abc9afd 100644
--- a/sysdeps/ieee754/ldbl-96/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-96/s_cosl.c
@@ -49,6 +49,7 @@ static char rcsid[] = "$NetBSD: $";
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -71,7 +72,11 @@ static char rcsid[] = "$NetBSD: $";
return __kernel_cosl(x,z);
/* cos(Inf or NaN) is NaN */
- else if (se==0x7fff) return x-x;
+ else if (se==0x7fff) {
+ if ((i0 | i1) == 0)
+ __set_errno (EDOM);
+ return x-x;
+ }
/* argument reduction needed */
else {
diff --git a/sysdeps/ieee754/ldbl-96/s_sinl.c b/sysdeps/ieee754/ldbl-96/s_sinl.c
index 4fd48805b4..b939bd6a99 100644
--- a/sysdeps/ieee754/ldbl-96/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-96/s_sinl.c
@@ -49,6 +49,7 @@ static char rcsid[] = "$NetBSD: $";
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -71,7 +72,11 @@ static char rcsid[] = "$NetBSD: $";
return __kernel_sinl(x,z,0);
/* sin(Inf or NaN) is NaN */
- else if (se==0x7fff) return x-x;
+ else if (se==0x7fff) {
+ if ((i0 | i1) == 0)
+ __set_errno (EDOM);
+ return x-x;
+ }
/* argument reduction needed */
else {