about summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32/s_tanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_tanf.c')
-rw-r--r--sysdeps/ieee754/flt-32/s_tanf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/ieee754/flt-32/s_tanf.c b/sysdeps/ieee754/flt-32/s_tanf.c
index e8f6016c32..4a852cb1f4 100644
--- a/sysdeps/ieee754/flt-32/s_tanf.c
+++ b/sysdeps/ieee754/flt-32/s_tanf.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_tanf.c,v 1.4 1995/05/10 20:48:20 jtc Exp $";
 #endif
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 
@@ -37,7 +38,11 @@ static char rcsid[] = "$NetBSD: s_tanf.c,v 1.4 1995/05/10 20:48:20 jtc Exp $";
 	if(ix <= 0x3f490fda) return __kernel_tanf(x,z,1);
 
     /* tan(Inf or NaN) is NaN */
-	else if (ix>=0x7f800000) return x-x;		/* NaN */
+	else if (ix>=0x7f800000) {
+	  if (ix==0x7f800000)
+	    __set_errno (EDOM);
+	  return x-x;		/* NaN */
+	}
 
     /* argument reduction needed */
 	else {