about summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32/s_cosf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_cosf.c')
-rw-r--r--sysdeps/ieee754/flt-32/s_cosf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/ieee754/flt-32/s_cosf.c b/sysdeps/ieee754/flt-32/s_cosf.c
index 86c59d440c..4f9f239f6f 100644
--- a/sysdeps/ieee754/flt-32/s_cosf.c
+++ b/sysdeps/ieee754/flt-32/s_cosf.c
@@ -8,7 +8,7 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
@@ -17,6 +17,7 @@
 static char rcsid[] = "$NetBSD: s_cosf.c,v 1.4 1995/05/10 20:47:03 jtc Exp $";
 #endif
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 
@@ -43,7 +44,11 @@ static float one=1.0;
 	if(ix <= 0x3f490fd8) return __kernel_cosf(x,z);
 
     /* cos(Inf or NaN) is NaN */
-	else if (ix>=0x7f800000) return x-x;
+	else if (ix>=0x7f800000) {
+	  if (ix == 0x7f800000)
+	    __set_errno (EDOM);
+	  return x-x;
+	}
 
     /* argument reduction needed */
 	else {