I noticed that the C++ version of <complex> has norm.However, I am programming in C, and there is no cnorm.  So I made one to define before my main function:#include <complex.h>double cnorm(double _Complex z){    return cpow(creal(z),2) + cpow(cimag(z),2);}How would you improve this definition? Is the name ok?  or will it break when it is eventually added to <complex.h>.  Is the return type appropriate?  Would it be more consistent to use double _Complex?  And is the implementation efficient (for rapid numerical evaluation)?
The C++ analog of norm in C
c
The code presented suffers from both performance and precision problems.  pow() and cpow() work by converting to logarithms and multiplying.  To square a floating-point value, it's quicker and more accurate to multiply it by itself:#include <complex.h>double cnorm(double _Complex z){    const double r = creal(z);    const double i = cimage(z);    return r*r + i*i;}You could multiply z by conj(z) (the imaginary terms ought to cancel), but the function above is cheaper and works in the double domain.cnorm() is not reserved by the Standard; the names reserved for future <complex.h> arecerf, cerfc, cexp2, cexpm1, clog10, clog1p, clog2, clgamma, ctgamma and their -f and -l suffixed variants