1#pragma once 2 3#ifdef __cplusplus 4extern "C" { 5#endif 6 7#define complex _Complex 8#ifdef __GNUC__ 9#define _Complex_I (__extension__(0.0f + 1.0fj)) 10#else 11#define _Complex_I (0.0f + 1.0fj) 12#endif 13#define I _Complex_I 14 15double complex cacos(double complex); 16float complex cacosf(float complex); 17long double complex cacosl(long double complex); 18 19double complex casin(double complex); 20float complex casinf(float complex); 21long double complex casinl(long double complex); 22 23double complex catan(double complex); 24float complex catanf(float complex); 25long double complex catanl(long double complex); 26 27double complex ccos(double complex); 28float complex ccosf(float complex); 29long double complex ccosl(long double complex); 30 31double complex csin(double complex); 32float complex csinf(float complex); 33long double complex csinl(long double complex); 34 35double complex ctan(double complex); 36float complex ctanf(float complex); 37long double complex ctanl(long double complex); 38 39double complex cacosh(double complex); 40float complex cacoshf(float complex); 41long double complex cacoshl(long double complex); 42 43double complex casinh(double complex); 44float complex casinhf(float complex); 45long double complex casinhl(long double complex); 46 47double complex catanh(double complex); 48float complex catanhf(float complex); 49long double complex catanhl(long double complex); 50 51double complex ccosh(double complex); 52float complex ccoshf(float complex); 53long double complex ccoshl(long double complex); 54 55double complex csinh(double complex); 56float complex csinhf(float complex); 57long double complex csinhl(long double complex); 58 59double complex ctanh(double complex); 60float complex ctanhf(float complex); 61long double complex ctanhl(long double complex); 62 63double complex cexp(double complex); 64float complex cexpf(float complex); 65long double complex cexpl(long double complex); 66 67double complex clog(double complex); 68float complex clogf(float complex); 69long double complex clogl(long double complex); 70 71double cabs(double complex); 72float cabsf(float complex); 73long double cabsl(long double complex); 74 75double complex cpow(double complex, double complex); 76float complex cpowf(float complex, float complex); 77long double complex cpowl(long double complex, long double complex); 78 79double complex csqrt(double complex); 80float complex csqrtf(float complex); 81long double complex csqrtl(long double complex); 82 83double carg(double complex); 84float cargf(float complex); 85long double cargl(long double complex); 86 87double cimag(double complex); 88float cimagf(float complex); 89long double cimagl(long double complex); 90 91double complex conj(double complex); 92float complex conjf(float complex); 93long double complex conjl(long double complex); 94 95double complex cproj(double complex); 96float complex cprojf(float complex); 97long double complex cprojl(long double complex); 98 99double creal(double complex); 100float crealf(float complex); 101long double creall(long double complex); 102 103#ifndef __cplusplus 104#define __CIMAG(x, t) \ 105 (+(union { \ 106 _Complex t __z; \ 107 t __xy[2]; \ 108 }){(_Complex t)(x)} \ 109 .__xy[1]) 110 111#define creal(x) ((double)(x)) 112#define crealf(x) ((float)(x)) 113#define creall(x) ((long double)(x)) 114 115#define cimag(x) __CIMAG(x, double) 116#define cimagf(x) __CIMAG(x, float) 117#define cimagl(x) __CIMAG(x, long double) 118#endif 119 120#if __STDC_VERSION__ >= 201112L 121#if defined(_Imaginary_I) 122#define __CMPLX(x, y, t) ((t)(x) + _Imaginary_I * (t)(y)) 123#elif defined(__clang__) 124#define __CMPLX(x, y, t) (+(_Complex t){(t)(x), (t)(y)}) 125#else 126#define __CMPLX(x, y, t) (__builtin_complex((t)(x), (t)(y))) 127#endif 128#define CMPLX(x, y) __CMPLX(x, y, double) 129#define CMPLXF(x, y) __CMPLX(x, y, float) 130#define CMPLXL(x, y) __CMPLX(x, y, long double) 131#endif 132 133#ifdef __cplusplus 134} 135#endif 136