Rich Felker | b69f695 | 2012-03-13 01:17:53 -0400 | [diff] [blame] | 1 | #ifndef _COMPLEX_H |
| 2 | #define _COMPLEX_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | #define complex _Complex |
| 9 | #define _Complex_I 1.0fi |
| 10 | #define I _Complex_I |
| 11 | |
| 12 | double complex cacos(double complex); |
| 13 | float complex cacosf(float complex); |
| 14 | long double complex cacosl(long double complex); |
| 15 | |
| 16 | double complex casin(double complex); |
| 17 | float complex casinf(float complex); |
| 18 | long double complex casinl(long double complex); |
| 19 | |
| 20 | double complex catan(double complex); |
| 21 | float complex catanf(float complex); |
| 22 | long double complex catanl(long double complex); |
| 23 | |
| 24 | double complex ccos(double complex); |
| 25 | float complex ccosf(float complex); |
| 26 | long double complex ccosl(long double complex); |
| 27 | |
| 28 | double complex csin(double complex); |
| 29 | float complex csinf(float complex); |
| 30 | long double complex csinl(long double complex); |
| 31 | |
| 32 | double complex ctan(double complex); |
| 33 | float complex ctanf(float complex); |
| 34 | long double complex ctanl(long double complex); |
| 35 | |
| 36 | double complex cacosh(double complex); |
| 37 | float complex cacoshf(float complex); |
| 38 | long double complex cacoshl(long double complex); |
| 39 | |
| 40 | double complex casinh(double complex); |
| 41 | float complex casinhf(float complex); |
| 42 | long double complex casinhl(long double complex); |
| 43 | |
| 44 | double complex catanh(double complex); |
| 45 | float complex catanhf(float complex); |
| 46 | long double complex catanhl(long double complex); |
| 47 | |
| 48 | double complex ccosh(double complex); |
| 49 | float complex ccoshf(float complex); |
| 50 | long double complex ccoshl(long double complex); |
| 51 | |
| 52 | double complex csinh(double complex); |
| 53 | float complex csinhf(float complex); |
| 54 | long double complex csinhl(long double complex); |
| 55 | |
| 56 | double complex ctanh(double complex); |
| 57 | float complex ctanhf(float complex); |
| 58 | long double complex ctanhl(long double complex); |
| 59 | |
| 60 | double complex cexp(double complex); |
| 61 | float complex cexpf(float complex); |
| 62 | long double complex cexpl(long double complex); |
| 63 | |
| 64 | double complex clog(double complex); |
| 65 | float complex clogf(float complex); |
| 66 | long double complex clogl(long double complex); |
| 67 | |
| 68 | double cabs(double complex); |
| 69 | float cabsf(float complex); |
| 70 | long double cabsl(long double complex); |
| 71 | |
| 72 | double complex cpow(double complex, double complex); |
| 73 | float complex cpowf(float complex, float complex); |
| 74 | long double complex cpowl(long double complex, long double complex); |
| 75 | |
| 76 | double complex csqrt(double complex); |
| 77 | float complex csqrtf(float complex); |
| 78 | long double complex csqrtl(long double complex); |
| 79 | |
| 80 | double carg(double complex); |
| 81 | float cargf(float complex); |
| 82 | long double cargl(long double complex); |
| 83 | |
| 84 | double cimag(double complex); |
| 85 | float cimagf(float complex); |
| 86 | long double cimagl(long double complex); |
| 87 | |
| 88 | double complex conj(double complex); |
| 89 | float complex conjf(float complex); |
| 90 | long double complex conjl(long double complex); |
| 91 | |
| 92 | double complex cproj(double complex); |
| 93 | float complex cprojf(float complex); |
| 94 | long double complex cprojl(long double complex); |
| 95 | |
| 96 | double creal(double complex); |
| 97 | float crealf(float complex); |
| 98 | long double creall(long double complex); |
| 99 | |
Rich Felker | 494ba80 | 2012-03-22 20:00:58 -0400 | [diff] [blame] | 100 | #define __CIMAG(x, t) \ |
| 101 | ((union { _Complex t __z; t __xy[2]; }){(_Complex t)(x)}.__xy[1]) |
Rich Felker | 13e400b | 2012-03-22 15:54:55 -0400 | [diff] [blame] | 102 | |
Rich Felker | 494ba80 | 2012-03-22 20:00:58 -0400 | [diff] [blame] | 103 | #define creal(x) ((double)(x)) |
| 104 | #define crealf(x) ((float)(x)) |
| 105 | #define creall(x) ((long double)(x)) |
Rich Felker | 13e400b | 2012-03-22 15:54:55 -0400 | [diff] [blame] | 106 | |
Rich Felker | 494ba80 | 2012-03-22 20:00:58 -0400 | [diff] [blame] | 107 | #define cimag(x) __CIMAG(x, double) |
| 108 | #define cimagf(x) __CIMAG(x, float) |
| 109 | #define cimagl(x) __CIMAG(x, long double) |
Rich Felker | 13e400b | 2012-03-22 15:54:55 -0400 | [diff] [blame] | 110 | |
Rich Felker | b69f695 | 2012-03-13 01:17:53 -0400 | [diff] [blame] | 111 | #ifdef __cplusplus |
| 112 | } |
| 113 | #endif |
| 114 | #endif |