Typecasting std::complex<double> to __complex128
I guess you're using GCC, in which case you can use the __real__
and __imag__
extensions to set the individual components of your __complex128
:
__complex128 y;
__real__ y = x.real();
__imag__ y = x.imag();
This works in Clang for __complex64, too (Clang doesn't yet support __complex128).