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