Commit 5bde96d2 by Steven G. Kargl

c99_functions.c (ccoshf, [...]): Fix errant minus.

2009-07-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	* c99_functions.c (ccoshf, ccosh, ccoshl, ctanhf, ctanh, ctanl):
	Fix errant minus.

From-SVN: r149479
parent 3c92a2b8
2009-07-10 Steven G. Kargl <kargl@gcc.gnu.org>
* c99_functions.c (ccoshf, ccosh, ccoshl, ctanhf, ctanh, ctanl):
Fix errant minus.
2009-07-08 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2009-07-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/40330 PR libfortran/40330
......
...@@ -1165,7 +1165,7 @@ csinhl (long double complex a) ...@@ -1165,7 +1165,7 @@ csinhl (long double complex a)
#endif #endif
/* cosh(a + i b) = cosh(a) cos(b) - i sinh(a) sin(b) */ /* cosh(a + i b) = cosh(a) cos(b) + i sinh(a) sin(b) */
#if !defined(HAVE_CCOSHF) #if !defined(HAVE_CCOSHF)
#define HAVE_CCOSHF 1 #define HAVE_CCOSHF 1
float complex float complex
...@@ -1176,7 +1176,7 @@ ccoshf (float complex a) ...@@ -1176,7 +1176,7 @@ ccoshf (float complex a)
r = REALPART (a); r = REALPART (a);
i = IMAGPART (a); i = IMAGPART (a);
COMPLEX_ASSIGN (v, coshf (r) * cosf (i), - (sinhf (r) * sinf (i))); COMPLEX_ASSIGN (v, coshf (r) * cosf (i), sinhf (r) * sinf (i));
return v; return v;
} }
#endif #endif
...@@ -1191,7 +1191,7 @@ ccosh (double complex a) ...@@ -1191,7 +1191,7 @@ ccosh (double complex a)
r = REALPART (a); r = REALPART (a);
i = IMAGPART (a); i = IMAGPART (a);
COMPLEX_ASSIGN (v, cosh (r) * cos (i), - (sinh (r) * sin (i))); COMPLEX_ASSIGN (v, cosh (r) * cos (i), sinh (r) * sin (i));
return v; return v;
} }
#endif #endif
...@@ -1206,13 +1206,13 @@ ccoshl (long double complex a) ...@@ -1206,13 +1206,13 @@ ccoshl (long double complex a)
r = REALPART (a); r = REALPART (a);
i = IMAGPART (a); i = IMAGPART (a);
COMPLEX_ASSIGN (v, coshl (r) * cosl (i), - (sinhl (r) * sinl (i))); COMPLEX_ASSIGN (v, coshl (r) * cosl (i), sinhl (r) * sinl (i));
return v; return v;
} }
#endif #endif
/* tanh(a + i b) = (tanh(a) + i tan(b)) / (1 - i tanh(a) tan(b)) */ /* tanh(a + i b) = (tanh(a) + i tan(b)) / (1 + i tanh(a) tan(b)) */
#if !defined(HAVE_CTANHF) #if !defined(HAVE_CTANHF)
#define HAVE_CTANHF 1 #define HAVE_CTANHF 1
float complex float complex
...@@ -1224,7 +1224,7 @@ ctanhf (float complex a) ...@@ -1224,7 +1224,7 @@ ctanhf (float complex a)
rt = tanhf (REALPART (a)); rt = tanhf (REALPART (a));
it = tanf (IMAGPART (a)); it = tanf (IMAGPART (a));
COMPLEX_ASSIGN (n, rt, it); COMPLEX_ASSIGN (n, rt, it);
COMPLEX_ASSIGN (d, 1, - (rt * it)); COMPLEX_ASSIGN (d, 1, rt * it);
return n / d; return n / d;
} }
...@@ -1241,7 +1241,7 @@ ctanh (double complex a) ...@@ -1241,7 +1241,7 @@ ctanh (double complex a)
rt = tanh (REALPART (a)); rt = tanh (REALPART (a));
it = tan (IMAGPART (a)); it = tan (IMAGPART (a));
COMPLEX_ASSIGN (n, rt, it); COMPLEX_ASSIGN (n, rt, it);
COMPLEX_ASSIGN (d, 1, - (rt * it)); COMPLEX_ASSIGN (d, 1, rt * it);
return n / d; return n / d;
} }
...@@ -1258,7 +1258,7 @@ ctanhl (long double complex a) ...@@ -1258,7 +1258,7 @@ ctanhl (long double complex a)
rt = tanhl (REALPART (a)); rt = tanhl (REALPART (a));
it = tanl (IMAGPART (a)); it = tanl (IMAGPART (a));
COMPLEX_ASSIGN (n, rt, it); COMPLEX_ASSIGN (n, rt, it);
COMPLEX_ASSIGN (d, 1, - (rt * it)); COMPLEX_ASSIGN (d, 1, rt * it);
return n / d; return n / d;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment