diff options
author | Ulrich Drepper <drepper@redhat.com> | 2009-05-29 12:00:22 -0700 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2009-05-29 12:00:22 -0700 |
commit | 7f3394bdf34e28b374e5569a7a74ddac734fb172 (patch) | |
tree | 70e5277461d3299d9706f79077843710dddbd177 /sysdeps/ieee754/ldbl-128/s_cosl.c | |
parent | b8bb339f7d684654295aca2dedb69c2c069a7cab (diff) | |
download | glibc-7f3394bdf34e28b374e5569a7a74ddac734fb172.tar glibc-7f3394bdf34e28b374e5569a7a74ddac734fb172.tar.gz glibc-7f3394bdf34e28b374e5569a7a74ddac734fb172.tar.bz2 glibc-7f3394bdf34e28b374e5569a7a74ddac734fb172.zip |
Fix errno for boundary conditions in 128-bit long double.
Similar to the changes which went already in for the other formats,
follow POSIX rules for errno.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/s_cosl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_cosl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_cosl.c b/sysdeps/ieee754/ldbl-128/s_cosl.c index d1258b2cf1..ef61c3afdb 100644 --- a/sysdeps/ieee754/ldbl-128/s_cosl.c +++ b/sysdeps/ieee754/ldbl-128/s_cosl.c @@ -44,6 +44,7 @@ * TRIG(x) returns trig(x) nearly rounded */ +#include <errno.h> #include "math.h" #include "math_private.h" @@ -66,7 +67,14 @@ return __kernel_cosl(x,z); /* cos(Inf or NaN) is NaN */ - else if (ix>=0x7fff000000000000LL) return x-x; + else if (ix>=0x7fff000000000000LL) { + if (ix == 0x7fff000000000000LL) { + GET_LDOUBLE_LSW64(n,x); + if (n == 0) + __set_errno (EDOM); + } + return x-x; + } /* argument reduction needed */ else { |