c语言双曲线正玄函数sinh()实例源码介绍。引入的头文件:#include <math.h>定义sinh()函数:double sinh(double x);
sinh()函数说明:sinh()用来计算参数x 的双曲线正玄值,然后将结果返回。数学定义式为:
(exp(x)-exp(-x))/2
返回值:返回参数x 的双曲线正玄值。
注意,使用 GCC 编译时请加入-lm。
范例
#include <math.h>
main(){
double answer = sinh(0.5);
printf(“sinh(0.5) = %f\n”, answer);
}
执行
sinh(0.5) = 0.521095