aboutsummaryrefslogtreecommitdiff
path: root/libquadmath/math/cosq.c
diff options
context:
space:
mode:
Diffstat (limited to 'libquadmath/math/cosq.c')
-rw-r--r--libquadmath/math/cosq.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libquadmath/math/cosq.c b/libquadmath/math/cosq.c
index 28630b9..6aabf0c 100644
--- a/libquadmath/math/cosq.c
+++ b/libquadmath/math/cosq.c
@@ -1,4 +1,4 @@
-/* cosq.c -- __float128 version of s_cos.c.
+/* s_cosl.c -- long double version of s_cos.c.
* Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -17,8 +17,8 @@
* Return cosine function of x.
*
* kernel function:
- * __quadmath_kernel_sinq ... sine function on [-pi/4,pi/4]
- * __quadmath_kernel_cosq ... cosine function on [-pi/4,pi/4]
+ * __quadmath_kernel_sinq ... sine function on [-pi/4,pi/4]
+ * __quadmath_kernel_cosq ... cosine function on [-pi/4,pi/4]
* __quadmath_rem_pio2q ... argument reduction routine
*
* Method.
@@ -46,10 +46,9 @@
#include "quadmath-imp.h"
-__float128
-cosq (__float128 x)
+__float128 cosq(__float128 x)
{
- __float128 y[2],z=0.0Q;
+ __float128 y[2],z=0;
int64_t n, ix;
/* High word of x. */
@@ -64,6 +63,8 @@ cosq (__float128 x)
else if (ix>=0x7fff000000000000LL) {
if (ix == 0x7fff000000000000LL) {
GET_FLT128_LSW64(n,x);
+ if (n == 0)
+ errno = EDOM;
}
return x-x;
}