summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/s_cosl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_cosl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cosl.c b/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
index 59a8196706..8470850fc8 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
@@ -44,6 +44,7 @@
  *	TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 #include <math_ldbl_opt.h>
@@ -67,9 +68,11 @@
 	  return __kernel_cosl(x,z);
 
     /* cos(Inf or NaN) is NaN */
-	else if (ix>=0x7ff0000000000000LL)
+	else if (ix>=0x7ff0000000000000LL) {
+	    if (ix == 0x7ff0000000000000LL)
+		__set_errno (EDOM);
 	    return x-x;
-
+	}
     /* argument reduction needed */
 	else {
 	    n = __ieee754_rem_pio2l(x,y);