]> git.proxmox.com Git - wasi-libc.git/blob - libc-bottom-half/sources/complex-builtins.c
b6588f7efeabd86229118e71a2c841905491a5e1
[wasi-libc.git] / libc-bottom-half / sources / complex-builtins.c
1 // Each of the following complex functions can be implemented with a single
2 // wasm instruction, so use that implementation rather than the portable
3 // one in libm.
4
5 #include <complex.h>
6
7 float crealf(float _Complex x) {
8 return __real__ x;
9 }
10
11 double creal(double _Complex x) {
12 return __real__ x;
13 }
14
15 float cimagf(float _Complex x) {
16 return __imag__ x;
17 }
18
19 double cimag(double _Complex x) {
20 return __imag__ x;
21 }