summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/flt-32/s_tanf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-26 05:42:49 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-26 05:42:49 +0000
commit337c270829f7088949ba0c96fffa6326fde17f78 (patch)
tree156108c0cf719838f421f4b30116ad8f3181056f /sysdeps/ieee754/flt-32/s_tanf.c
parent002a604fd61d1d3b8d82a5a85959ba4ebd210aec (diff)
downloadglibc-337c270829f7088949ba0c96fffa6326fde17f78.tar.gz
* sysdeps/i386/fpu/s_tan.S: Set errno for ±Inf.
* sysdeps/i386/fpu/s_tanf.S: Likewise. * sysdeps/i386/fpu/s_tanl.S: Likewise. * sysdeps/ieee754/dbl-64/s_tan.c: Likewise. * sysdeps/ieee754/flt-32/s_tanf.c: Likewise. * sysdeps/x86_64/fpu/s_tanl.S: Likewise. * math/libm-test.inc: Add tests for errno after tan calls with ±Inf.
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 {