aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-96/s_tanl.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-03-16 20:05:04 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-03-16 20:05:37 +0000
commit11b90b9f504df5b2da91ce3a06c1657d99e4a95f (patch)
tree838df025f383c47096e24ac377aa45d48d9200b7 /sysdeps/ieee754/ldbl-96/s_tanl.c
parent6a1bd2a100c958d30bbfe8c9b8f9071d24b7c3f4 (diff)
downloadglibc-11b90b9f504df5b2da91ce3a06c1657d99e4a95f.tar
glibc-11b90b9f504df5b2da91ce3a06c1657d99e4a95f.tar.gz
glibc-11b90b9f504df5b2da91ce3a06c1657d99e4a95f.tar.bz2
glibc-11b90b9f504df5b2da91ce3a06c1657d99e4a95f.zip
Fix tan, tanl for large inputs.
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/s_tanl.c')
-rw-r--r--sysdeps/ieee754/ldbl-96/s_tanl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_tanl.c b/sysdeps/ieee754/ldbl-96/s_tanl.c
index 3054601a50..3fbe4a8f6b 100644
--- a/sysdeps/ieee754/ldbl-96/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-96/s_tanl.c
@@ -48,23 +48,28 @@ static char rcsid[] = "$NetBSD: $";
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include <math.h>
#include <math_private.h>
long double __tanl(long double x)
{
long double y[2],z=0.0;
- int32_t n, se;
+ int32_t n, se, i0, i1;
/* High word of x. */
- GET_LDOUBLE_EXP(se,x);
+ GET_LDOUBLE_WORDS(se,i0,i1,x);
/* |x| ~< pi/4 */
se &= 0x7fff;
if(se <= 0x3ffe) return __kernel_tanl(x,z,1);
/* tan(Inf or NaN) is NaN */
- else if (se==0x7fff) return x-x; /* NaN */
+ else if (se==0x7fff) {
+ if (i1 == 0 && i0 == 0x80000000)
+ __set_errno (EDOM);
+ return x-x;
+ }
/* argument reduction needed */
else {