xref: /haiku/src/system/libroot/posix/glibc/arch/generic/s_cacosl.c (revision 5acbf1f50e02444d18af1f304cefe619400d5e2c)
1*5acbf1f5SJérôme Duval /* Return cosine of complex long double value.
2*5acbf1f5SJérôme Duval    Copyright (C) 1997, 1998 Free Software Foundation, Inc.
3*5acbf1f5SJérôme Duval    This file is part of the GNU C Library.
4*5acbf1f5SJérôme Duval    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
5*5acbf1f5SJérôme Duval 
6*5acbf1f5SJérôme Duval    The GNU C Library is free software; you can redistribute it and/or
7*5acbf1f5SJérôme Duval    modify it under the terms of the GNU Lesser General Public
8*5acbf1f5SJérôme Duval    License as published by the Free Software Foundation; either
9*5acbf1f5SJérôme Duval    version 2.1 of the License, or (at your option) any later version.
10*5acbf1f5SJérôme Duval 
11*5acbf1f5SJérôme Duval    The GNU C Library is distributed in the hope that it will be useful,
12*5acbf1f5SJérôme Duval    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*5acbf1f5SJérôme Duval    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14*5acbf1f5SJérôme Duval    Lesser General Public License for more details.
15*5acbf1f5SJérôme Duval 
16*5acbf1f5SJérôme Duval    You should have received a copy of the GNU Lesser General Public
17*5acbf1f5SJérôme Duval    License along with the GNU C Library; if not, write to the Free
18*5acbf1f5SJérôme Duval    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19*5acbf1f5SJérôme Duval    02111-1307 USA.  */
20*5acbf1f5SJérôme Duval 
21*5acbf1f5SJérôme Duval #include <complex.h>
22*5acbf1f5SJérôme Duval #include <math.h>
23*5acbf1f5SJérôme Duval 
24*5acbf1f5SJérôme Duval __complex__ long double
__cacosl(__complex__ long double x)25*5acbf1f5SJérôme Duval __cacosl (__complex__ long double x)
26*5acbf1f5SJérôme Duval {
27*5acbf1f5SJérôme Duval   __complex__ long double y;
28*5acbf1f5SJérôme Duval   __complex__ long double res;
29*5acbf1f5SJérôme Duval 
30*5acbf1f5SJérôme Duval   y = __casinl (x);
31*5acbf1f5SJérôme Duval 
32*5acbf1f5SJérôme Duval   __real__ res = M_PI_2l - __real__ y;
33*5acbf1f5SJérôme Duval   __imag__ res = -__imag__ y;
34*5acbf1f5SJérôme Duval 
35*5acbf1f5SJérôme Duval   return res;
36*5acbf1f5SJérôme Duval }
37*5acbf1f5SJérôme Duval weak_alias (__cacosl, cacosl)
38