ctan函数用法详解
ctan函数简介
- 头文件包含
#include <complex.h>
- 函数定义
double complex ctan(double complex z );
float complex ctanf(float complex z );
long double complex ctanl(long double complex z );
- 编译链接选项
-lm
ctan函数常见使用错误
- 链接错误
undefined reference to `ctan'
解决办法:添加链接选项
-lm
- 编译错误
warning: implicit declaration of function ‘ctan’ [-Wimplicit-function-declaration]
解决办法:包含头文件
#include <complex.h>
ctan函数详细描述
这些函数计算z 的复切线
复切函数定义为:
ctan(z) = csin(z) / ccos(z)
评论区