PHP tanh() 函数


PHP tanh() 函数

定义和用法

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

语法

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

说明

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

实例

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

<?phpecho(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.6557942026330.46211715726-0.462117157260.9999092042630.999999995878-0.999909204263-0.999999995878
标签:, , ,