C 语言 atanh() 函数用于计算一个数的反双曲正切值,参数必须在 (-1, 1) 范围内。
原型
double atanh(double x);示例
#include <stdio.h>
#include <math.h>
int main() {
printf("atanh(0.5) = %.4f\n", atanh(0.5));
return 0;
}输出:
atanh(0.5) = 0.5493注意事项
使用 math.h 的函数时,多数编译器需要链接数学库(编译选项 -lm)。