diff libquadmath/math/cosq.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line diff
--- a/libquadmath/math/cosq.c	Thu Oct 25 07:37:49 2018 +0900
+++ b/libquadmath/math/cosq.c	Thu Feb 13 11:34:05 2020 +0900
@@ -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 @@
 	else if (ix>=0x7fff000000000000LL) {
 	    if (ix == 0x7fff000000000000LL) {
 		GET_FLT128_LSW64(n,x);
+		if (n == 0)
+		    errno = EDOM;
 	    }
 	    return x-x;
 	}