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