xref: /openbsd/include/complex.h (revision 7b36286a)
1 /*	$OpenBSD: complex.h,v 1.1 2008/09/07 20:36:07 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 #endif
32 
33 #define complex		_Complex
34 
35 /* XXX switch to _Imaginary_I */
36 #undef I
37 #define I		_Complex_I
38 
39 __BEGIN_DECLS
40 /*
41  * Double versions of C99 functions
42  */
43 double complex cacos(double complex);
44 double complex casin(double complex);
45 double complex catan(double complex);
46 double complex ccos(double complex);
47 double complex csin(double complex);
48 double complex ctan(double complex);
49 double complex cacosh(double complex);
50 double complex casinh(double complex);
51 double complex catanh(double complex);
52 double complex ccosh(double complex);
53 double complex csinh(double complex);
54 double complex ctanh(double complex);
55 double complex cexp(double complex);
56 double complex clog(double complex);
57 double cabs(double complex);
58 double complex cpow(double complex, double complex);
59 double complex csqrt(double complex);
60 double carg(double complex);
61 double cimag(double complex);
62 double complex conj(double complex);
63 double complex cproj(double complex);
64 double creal(double complex);
65 
66 /*
67  * Float versions of C99 functions
68  */
69 float complex cacosf(float complex);
70 float complex casinf(float complex);
71 float complex catanf(float complex);
72 float complex ccosf(float complex);
73 float complex csinf(float complex);
74 float complex ctanf(float complex);
75 float complex cacoshf(float complex);
76 float complex casinhf(float complex);
77 float complex catanhf(float complex);
78 float complex ccoshf(float complex);
79 float complex csinhf(float complex);
80 float complex ctanhf(float complex);
81 float complex cexpf(float complex);
82 float complex clogf(float complex);
83 float cabsf(float complex);
84 float complex cpowf(float complex, float complex);
85 float complex csqrtf(float complex);
86 float cargf(float complex);
87 float cimagf(float complex);
88 float complex conjf(float complex);
89 float complex cprojf(float complex);
90 float crealf(float complex);
91 
92 /*
93  * Long double versions of C99 functions
94  */
95 #if 0
96 long double complex cacosl(long double complex);
97 long double complex casinl(long double complex);
98 long double complex catanl(long double complex);
99 long double complex ccosl(long double complex);
100 long double complex csinl(long double complex);
101 long double complex ctanl(long double complex);
102 long double complex cacoshl(long double complex);
103 long double complex casinhl(long double complex);
104 long double complex catanhl(long double complex);
105 long double complex ccoshl(long double complex);
106 long double complex csinhl(long double complex);
107 long double complex ctanhl(long double complex);
108 long double complex cexpl(long double complex);
109 long double complex clogl(long double complex);
110 long double cabsl(long double complex);
111 long double complex cpowl(long double complex,
112 	long double complex);
113 long double complex csqrtl(long double complex);
114 long double cargl(long double complex);
115 long double cimagl(long double complex);
116 long double complex conjl(long double complex);
117 long double complex cprojl(long double complex);
118 long double creall(long double complex);
119 #endif
120 __END_DECLS
121 
122 #endif _COMPLEX_H_ /* !_COMPLEX_H_ */
123