cpow函数用法详解
cpow函数简介
- 头文件包含
#include <complex.h>
- 函数定义
double complex cpow(double complex x , complex double z );
float complex cpowf(float complex x , complex float z );
long double complex cpowl(long double complex x ,
complex long double z );
- 编译链接选项
-lm
cpow函数常见使用错误
- 链接错误
undefined reference to `cpow'
解决办法:添加链接选项
-lm
- 编译错误
warning: implicit declaration of function ‘cpow’ [-Wimplicit-function-declaration]
解决办法:包含头文件
#include <complex.h>
cpow函数详细描述
这些函数计算x乘以z的幂(沿着负实轴为x切一个分支)
评论区