C 库函数 - tanh()

C 语言教程 · 2019-02-23 07:58:15

描述

C 库函数 double tanh(double x) 返回 x 的双曲正切。

声明

下面是 tanh() 函数的声明。

double tanh(double x)

参数

  • x -- 浮点值。

返回值

该函数返回 x 的双曲正切。

实例

下面的实例演示了 tanh() 函数的用法。

#include <stdio.h>
#include <math.h>

int main ()
{
   double x, ret;
   x = 0.5;

   ret = tanh(x);
   printf("%lf 的双曲正切是 %lf 度", x, ret);
   
   return(0);
}

让我们编译并运行上面的程序,这将产生以下结果:

0.500000 的双曲正切是 0.462117 度

点击查看所有 C 语言教程 文章: https://www.codercto.com/courses/l/17.html

查看所有标签

About Face 3

About Face 3

Alan Cooper、Robert Reimann、David Cronin / John Wiley & Sons / 2007-5-15 / GBP 28.99

* The return of the authoritative bestseller includes all new content relevant to the popularization of how About Face maintains its relevance to new Web technologies such as AJAX and mobile platforms......一起来看看 《About Face 3》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码