PHP tanh() 函数

PHP Math 函数


定义和用法

tanh() 函数返回双曲正切。

语法

tanh(x)
参数 描述
x 必需。一个数。

说明

返回 x 的双曲正切值,定义为 sinh(arg)/cosh(arg)。


例子

在本例中,我们将返回不同的数的双曲正切:

<?php
echo(tanh(M_PI_4));
echo(tanh(0.50));
echo(tanh(-0.50));
echo(tanh(5));
echo(tanh(10));
echo(tanh(-5));
echo(tanh(-10))
?>

输出:

0.655794202633
0.46211715726
-0.46211715726
0.999909204263
0.999999995878
-0.999909204263
-0.999999995878

PHP Math 函数

本教程仅供参考学习,如用于商业带来的问题,本站概不负责。
关注公众号
关注公众号

©2020 IT自习室京ICP备20010815号