曲径通幽论坛

标题: tanh() -- 计算双曲线正切函数值 [打印本页]

作者: beyes    时间: 2011-12-24 11:42
标题: tanh() -- 计算双曲线正切函数值
tanh() 原型如下:
[Plain Text] 纯文本查看 复制代码
#include <math.h>
double tanh(double x);

tanh() 用来计算参数 x 的双曲线正切值,然后将结果返回。双曲线正切公式为:
[attach]141[/attach]
相应曲线如下图所示:


测试代码
[C++] 纯文本查看 复制代码
#include <stdio.h>
#include <math.h>

int main()
{      
        double result = tanh(0.5);
        
        printf ("tanh(0.5) = %f\n", result);
        
        return 0;
}   

运行输出:
./tanh
tanh(0.5) = 0.462117





欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2