PHP tanh() 函數

定義和用法

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