diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-03-22 12:52:50 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-03-22 12:52:50 +0000 |
commit | c0df8e693f34b535bd6ee1b691bc4ca6bc3b4579 (patch) | |
tree | 9cc7aef340a2766375fb6b317c61df7c1df9b1b5 /sysdeps/ieee754/ldbl-128/k_cosl.c | |
parent | e4d91429aefd7f3ad97457f8935cf675aacfde2a (diff) | |
download | glibc-c0df8e693f34b535bd6ee1b691bc4ca6bc3b4579.tar.gz glibc-c0df8e693f34b535bd6ee1b691bc4ca6bc3b4579.tar.xz glibc-c0df8e693f34b535bd6ee1b691bc4ca6bc3b4579.zip |
Fix low-part sign handling in sin/cos for ldbl-128 and ldbl-128ibm.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/k_cosl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-128/k_cosl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sysdeps/ieee754/ldbl-128/k_cosl.c b/sysdeps/ieee754/ldbl-128/k_cosl.c index 4cb9dd1f56..aa447ec1db 100644 --- a/sysdeps/ieee754/ldbl-128/k_cosl.c +++ b/sysdeps/ieee754/ldbl-128/k_cosl.c @@ -105,7 +105,11 @@ __kernel_cosl(long double x, long double y) cosl(h+l) = cosl(h)cosl(l) - sinl(h)sinl(l). */ index = 0x3ffe - (tix >> 16); hix = (tix + (0x200 << index)) & (0xfffffc00 << index); - x = fabsl (x); + if (signbit (x)) + { + x = -x; + y = -y; + } switch (index) { case 0: index = ((45 << 10) + hix - 0x3ffe0000) >> 8; break; |