直接上代码:
#include <iostream>
#include <complex>
using namespace std;
int main ()
{
complex<double> mycomplex (3.0,4.0);
cout << "The norm of " << mycomplex << " is " << norm(mycomplex) << endl;
return 0;
}
输出为:
25
意思就是求范数
参考:
https://blog.csdn.net/gxiaob/article/details/8471158