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