complex: Add initial complex support.
[altfloat.git] / complex.c
blob30f6e7dc0f5708b0738ef4bb70c3d74e3096447d
1 #include <complex.h>
3 #define complex_wrap1(T, func) void func ## _wrap(T complex *a) { \
4 *a = func(*a); \
7 complex_wrap1(double, cacos)
8 complex_wrap1(double, casin)
9 complex_wrap1(double, catan)
10 complex_wrap1(double, ccos)
11 complex_wrap1(double, csin)
12 complex_wrap1(double, ctan)
14 complex_wrap1(double, cacosh)
15 complex_wrap1(double, casinh)
16 complex_wrap1(double, catanh)
17 complex_wrap1(double, ccosh)
18 complex_wrap1(double, csinh)
19 complex_wrap1(double, ctanh)
21 double cabs_wrap(const double complex *a)
23 return cabs(*a);
26 complex_wrap1(double, cexp)
27 complex_wrap1(double, clog)
29 complex_wrap1(double, csqrt)
31 void cpow_wrap(double complex *a, const double complex *b)
33 *a = cpow(*a, *b);
36 complex_wrap1(double, cproj)
38 double carg_wrap(const double complex *a)
40 return carg(*a);