I am coding a simple DFT algorithm now and I want to use the complex number i in complex exponential. I saw somebody use #include and #include&
#include
#include&
Another way is to use std::literals::complex_literals::operator""i after C++14:
#include #include int main() { using namespace std::complex_literals; auto c = 1.0 + 3.0i; std::cout << "c = " << c << '\n'; }
Output:
c = (1,3)