Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / include / complex.h
blobdbabdf67a4cac34c11eae3ef6f899572214db500
1 /* $NetBSD: complex.h,v 1.3 2010/09/15 16:11:30 christos Exp $ */
3 /*
4 * Written by Matthias Drochner.
5 * Public domain.
6 */
8 #ifndef _COMPLEX_H
9 #define _COMPLEX_H
11 #define complex _Complex
12 #define _Complex_I 1.0fi
13 #define I _Complex_I
15 #include <sys/cdefs.h>
17 __BEGIN_DECLS
19 /* Implementation from FreeBSD */
20 #if __ISO_C_VISIBLE >= 2011
21 #ifdef __clang__
22 #define CMPLX(x, y) ((double complex){ x, y })
23 #define CMPLXF(x, y) ((float complex){ x, y })
24 #define CMPLXL(x, y) ((long double complex){ x, y })
25 #elif __GNUC_PREREQ__(4, 7)
26 #define CMPLX(x, y) __builtin_complex((double)(x), (double)(y))
27 #define CMPLXF(x, y) __builtin_complex((float)(x), (float)(y))
28 #define CMPLXL(x, y) __builtin_complex((long double)(x), (long double)(y))
29 #endif
30 #endif /* __ISO_C_VISIBLE >= 2011 */
32 /* 7.3.5 Trigonometric functions */
33 /* 7.3.5.1 The cacos functions */
34 double complex cacos(double complex);
35 float complex cacosf(float complex);
36 long double complex cacosl(long double complex);
38 /* 7.3.5.2 The casin functions */
39 double complex casin(double complex);
40 float complex casinf(float complex);
41 long double complex casinl(long double complex);
43 /* 7.3.5.1 The catan functions */
44 double complex catan(double complex);
45 float complex catanf(float complex);
46 long double complex catanl(long double complex);
48 /* 7.3.5.1 The ccos functions */
49 double complex ccos(double complex);
50 float complex ccosf(float complex);
51 long double complex ccosl(long double complex);
53 /* 7.3.5.1 The csin functions */
54 double complex csin(double complex);
55 float complex csinf(float complex);
56 long double complex csinl(long double complex);
58 /* 7.3.5.1 The ctan functions */
59 double complex ctan(double complex);
60 float complex ctanf(float complex);
61 long double complex ctanl(long double complex);
63 /* 7.3.6 Hyperbolic functions */
64 /* 7.3.6.1 The cacosh functions */
65 double complex cacosh(double complex);
66 float complex cacoshf(float complex);
67 long double complex cacoshl(long double complex);
69 /* 7.3.6.2 The casinh functions */
70 double complex casinh(double complex);
71 float complex casinhf(float complex);
72 long double complex casinhl(long double complex);
74 /* 7.3.6.3 The catanh functions */
75 double complex catanh(double complex);
76 float complex catanhf(float complex);
77 long double complex catanhl(long double complex);
79 /* 7.3.6.4 The ccosh functions */
80 double complex ccosh(double complex);
81 float complex ccoshf(float complex);
82 long double complex ccoshl(long double complex);
84 /* 7.3.6.5 The csinh functions */
85 double complex csinh(double complex);
86 float complex csinhf(float complex);
87 long double complex csinhl(long double complex);
89 /* 7.3.6.6 The ctanh functions */
90 double complex ctanh(double complex);
91 float complex ctanhf(float complex);
92 long double complex ctanhl(long double complex);
94 /* 7.3.7 Exponential and logarithmic functions */
95 /* 7.3.7.1 The cexp functions */
96 double complex cexp(double complex);
97 float complex cexpf(float complex);
98 long double complex cexpl(long double complex);
100 /* 7.3.7.2 The clog functions */
101 double complex clog(double complex);
102 float complex clogf(float complex);
103 long double complex clogl(long double complex);
105 /* 7.3.8 Power and absolute-value functions */
106 /* 7.3.8.1 The cabs functions */
107 /*#ifndef __LIBM0_SOURCE__ */
108 /* avoid conflict with historical cabs(struct complex) */
109 /* double cabs(double complex) __RENAME(__c99_cabs);
110 float cabsf(float complex) __RENAME(__c99_cabsf);
111 #endif
113 long double cabsl(long double complex) ;
114 double cabs(double complex) ;
115 float cabsf(float complex) ;
117 /* 7.3.8.2 The cpow functions */
118 double complex cpow(double complex, double complex);
119 float complex cpowf(float complex, float complex);
120 long double complex cpowl(long double complex, long double complex);
122 /* 7.3.8.3 The csqrt functions */
123 double complex csqrt(double complex);
124 float complex csqrtf(float complex);
125 long double complex csqrtl(long double complex);
127 /* 7.3.9 Manipulation functions */
128 /* 7.3.9.1 The carg functions */
129 double carg(double complex);
130 float cargf(float complex);
131 long double cargl(long double complex);
133 /* 7.3.9.2 The cimag functions */
134 double cimag(double complex);
135 float cimagf(float complex);
136 long double cimagl(long double complex);
138 /* 7.3.9.3 The conj functions */
139 double complex conj(double complex);
140 float complex conjf(float complex);
141 long double complex conjl(long double complex);
143 /* 7.3.9.4 The cproj functions */
144 double complex cproj(double complex);
145 float complex cprojf(float complex);
146 long double complex cprojl(long double complex);
148 /* 7.3.9.5 The creal functions */
149 double creal(double complex);
150 float crealf(float complex);
151 long double creall(long double complex);
153 #if __GNU_VISIBLE
154 double complex clog10(double complex);
155 float complex clog10f(float complex);
156 # if defined(__CYGWIN__)
157 long double complex clog10l(long double complex);
158 # endif
159 #endif
161 __END_DECLS
163 #endif /* ! _COMPLEX_H */