1 /* $NetBSD: complex.h,v 1.3 2010/09/15 16:11:30 christos Exp $ */ 2 3 /* 4 * Copyright (c) 2010 Matthias Drochner. 5 * Public domain. 6 */ 7 8 #ifndef _COMPLEX_H 9 #define _COMPLEX_H 10 11 #include <sys/cdefs.h> 12 13 #define complex _Complex 14 #define _Complex_I 1.0fi 15 #define I _Complex_I 16 17 _BEGIN_STD_C 18 19 /* 7.3.5 Trigonometric functions */ 20 /* 7.3.5.1 The cacos functions */ 21 double complex cacos(double complex); 22 float complex cacosf(float complex); 23 24 /* 7.3.5.2 The casin functions */ 25 double complex casin(double complex); 26 float complex casinf(float complex); 27 28 /* 7.3.5.1 The catan functions */ 29 double complex catan(double complex); 30 float complex catanf(float complex); 31 32 /* 7.3.5.1 The ccos functions */ 33 double complex ccos(double complex); 34 float complex ccosf(float complex); 35 36 /* 7.3.5.1 The csin functions */ 37 double complex csin(double complex); 38 float complex csinf(float complex); 39 40 /* 7.3.5.1 The ctan functions */ 41 double complex ctan(double complex); 42 float complex ctanf(float complex); 43 44 /* 7.3.6 Hyperbolic functions */ 45 /* 7.3.6.1 The cacosh functions */ 46 double complex cacosh(double complex); 47 float complex cacoshf(float complex); 48 49 /* 7.3.6.2 The casinh functions */ 50 double complex casinh(double complex); 51 float complex casinhf(float complex); 52 53 /* 7.3.6.3 The catanh functions */ 54 double complex catanh(double complex); 55 float complex catanhf(float complex); 56 57 /* 7.3.6.4 The ccosh functions */ 58 double complex ccosh(double complex); 59 float complex ccoshf(float complex); 60 61 /* 7.3.6.5 The csinh functions */ 62 double complex csinh(double complex); 63 float complex csinhf(float complex); 64 65 /* 7.3.6.6 The ctanh functions */ 66 double complex ctanh(double complex); 67 float complex ctanhf(float complex); 68 69 /* 7.3.7 Exponential and logarithmic functions */ 70 /* 7.3.7.1 The cexp functions */ 71 double complex cexp(double complex); 72 float complex cexpf(float complex); 73 74 /* 7.3.7.2 The clog functions */ 75 double complex clog(double complex); 76 float complex clogf(float complex); 77 78 /* 7.3.8 Power and absolute-value functions */ 79 /* 7.3.8.1 The cabs functions */ 80 double cabs(double complex); 81 float cabsf(float complex); 82 83 /* 7.3.8.2 The cpow functions */ 84 double complex cpow(double complex, double complex); 85 float complex cpowf(float complex, float complex); 86 87 /* 7.3.8.3 The csqrt functions */ 88 double complex csqrt(double complex); 89 float complex csqrtf(float complex); 90 91 /* 7.3.9 Manipulation functions */ 92 /* 7.3.9.1 The carg functions */ 93 double carg(double complex); 94 float cargf(float complex); 95 96 /* 7.3.9.2 The cimag functions */ 97 double cimag(double complex); 98 float cimagf(float complex); 99 100 /* 7.3.9.3 The conj functions */ 101 double complex conj(double complex); 102 float complex conjf(float complex); 103 104 /* 7.3.9.4 The cproj functions */ 105 double complex cproj(double complex); 106 float complex cprojf(float complex); 107 108 /* 7.3.9.5 The creal functions */ 109 double creal(double complex); 110 float crealf(float complex); 111 112 #if __ISO_C_VISIBLE >= 2011 113 #ifdef _HAVE_BUILTIN_COMPLEX 114 #define CMPLX(r,i) __builtin_complex((double)(r), (double)(i)) 115 #define CMPLXF(r,i) __builtin_complex((float)(r), (float)(i)) 116 #define CMPLXL(r,i) __builtin_complex((long double)(r), (long double)(i)) 117 #else 118 #define CMPLX(r,i) ((double complex) ((double) (r) + (double complex) I * (double) (i))) 119 #define CMPLXF(r,i) ((float complex) ((float) (r) + (float complex) I * (float) (i))) 120 #define CMPLXL(r,i) ((long double complex) ((long double) (r) + (long double complex) I * (long double) (i))) 121 #endif 122 #endif 123 124 #if __GNU_VISIBLE 125 double complex clog10(double complex); 126 float complex clog10f(float complex); 127 #endif 128 129 #ifdef _HAVE_LONG_DOUBLE 130 long double complex csqrtl(long double complex); 131 long double cabsl(long double complex) ; 132 long double complex cprojl(long double complex); 133 long double creall(long double complex); 134 long double complex conjl(long double complex); 135 long double cimagl(long double complex); 136 137 #ifdef _HAVE_LONG_DOUBLE_MATH 138 long double cargl(long double complex); 139 long double complex casinl(long double complex); 140 long double complex cacosl(long double complex); 141 long double complex catanl(long double complex); 142 long double complex ccosl(long double complex); 143 long double complex csinl(long double complex); 144 long double complex ctanl(long double complex); 145 long double complex cacoshl(long double complex); 146 long double complex casinhl(long double complex); 147 long double complex catanhl(long double complex); 148 long double complex ccoshl(long double complex); 149 long double complex csinhl(long double complex); 150 long double complex ctanhl(long double complex); 151 long double complex cexpl(long double complex); 152 long double complex clogl(long double complex); 153 long double complex cpowl(long double complex, long double complex); 154 #if __GNU_VISIBLE 155 long double complex clog10l(long double complex); 156 #endif 157 #endif /* _HAVE_LONG_DOUBLE_MATH */ 158 159 #endif /* _HAVE_LONG_DOUBLE */ 160 161 _END_STD_C 162 163 #endif /* ! _COMPLEX_H */ 164