xref: /openbsd-src/include/complex.h (revision d13be5d47e4149db2549a9828e244d59dbc43f15)
1 /*	$OpenBSD: complex.h,v 1.4 2011/07/08 19:25:31 martynas Exp $	*/
2 /*
3  * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 #ifndef _COMPLEX_H_
19 #define	_COMPLEX_H_
20 
21 #include <sys/cdefs.h>
22 
23 /*
24  * C99
25  */
26 #ifdef __GNUC__
27 #if __STDC_VERSION__ < 199901
28 #define _Complex	__complex__
29 #endif
30 #define _Complex_I	1.0fi
31 #elif defined(lint)
32 #define _Complex_I	1.0fi
33 #endif
34 
35 #define complex		_Complex
36 
37 /* XXX switch to _Imaginary_I */
38 #undef I
39 #define I		_Complex_I
40 
41 __BEGIN_DECLS
42 /*
43  * Double versions of C99 functions
44  */
45 double complex cacos(double complex);
46 double complex casin(double complex);
47 double complex catan(double complex);
48 double complex ccos(double complex);
49 double complex csin(double complex);
50 double complex ctan(double complex);
51 double complex cacosh(double complex);
52 double complex casinh(double complex);
53 double complex catanh(double complex);
54 double complex ccosh(double complex);
55 double complex csinh(double complex);
56 double complex ctanh(double complex);
57 double complex cexp(double complex);
58 double complex clog(double complex);
59 double cabs(double complex);
60 double complex cpow(double complex, double complex);
61 double complex csqrt(double complex);
62 double carg(double complex);
63 double cimag(double complex);
64 double complex conj(double complex);
65 double complex cproj(double complex);
66 double creal(double complex);
67 
68 /*
69  * Float versions of C99 functions
70  */
71 float complex cacosf(float complex);
72 float complex casinf(float complex);
73 float complex catanf(float complex);
74 float complex ccosf(float complex);
75 float complex csinf(float complex);
76 float complex ctanf(float complex);
77 float complex cacoshf(float complex);
78 float complex casinhf(float complex);
79 float complex catanhf(float complex);
80 float complex ccoshf(float complex);
81 float complex csinhf(float complex);
82 float complex ctanhf(float complex);
83 float complex cexpf(float complex);
84 float complex clogf(float complex);
85 float cabsf(float complex);
86 float complex cpowf(float complex, float complex);
87 float complex csqrtf(float complex);
88 float cargf(float complex);
89 float cimagf(float complex);
90 float complex conjf(float complex);
91 float complex cprojf(float complex);
92 float crealf(float complex);
93 
94 /*
95  * Long double versions of C99 functions
96  */
97 long double complex cacosl(long double complex);
98 long double complex casinl(long double complex);
99 long double complex catanl(long double complex);
100 long double complex ccosl(long double complex);
101 long double complex csinl(long double complex);
102 long double complex ctanl(long double complex);
103 long double complex cacoshl(long double complex);
104 long double complex casinhl(long double complex);
105 long double complex catanhl(long double complex);
106 long double complex ccoshl(long double complex);
107 long double complex csinhl(long double complex);
108 long double complex ctanhl(long double complex);
109 long double complex cexpl(long double complex);
110 long double complex clogl(long double complex);
111 long double cabsl(long double complex);
112 long double complex cpowl(long double complex,
113 	long double complex);
114 long double complex csqrtl(long double complex);
115 long double cargl(long double complex);
116 long double cimagl(long double complex);
117 long double complex conjl(long double complex);
118 long double complex cprojl(long double complex);
119 long double creall(long double complex);
120 __END_DECLS
121 
122 #endif /* !_COMPLEX_H_ */
123