PHP tanh () function
Examples
Returns the number of different hyperbolic tangent:
<?php
echo(tanh(M_PI_4) . "<br>");
echo(tanh(0.50) . "<br>");
echo(tanh(-0.50) . "<br>");
echo(tanh(5) . "<br>");
echo(tanh(10) . "<br>");
echo(tanh(-5) . "<br>");
echo(tanh(-10));
?>
echo(tanh(M_PI_4) . "<br>");
echo(tanh(0.50) . "<br>");
echo(tanh(-0.50) . "<br>");
echo(tanh(5) . "<br>");
echo(tanh(10) . "<br>");
echo(tanh(-5) . "<br>");
echo(tanh(-10));
?>
Running instance »
Definition and Usage
tanh () function returns the hyperbolic tangent of a number, defined as sinh (x) / cosh (x).
grammar
tanh( number );
参数 | 描述 |
---|---|
number | 必需。规定一个数。 |
technical details
return value: | number hyperbolic tangent. |
---|---|
Return type: | Float |
PHP version: | 4.1+ |
PHP Math Reference