PHP tanh()Function

PHP Math 参考手册PHP Math Reference Manual

Examples

Returns the hyperbolic tangent of different numbers:

<?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));
?>

Run example »

Definition and Usage

The tanh() function returns the hyperbolic tangent of a number, defined as sinh(x)/cosh(x).


Syntax

tanh(number);

Parameters Description
number Required. Specifies a number.

Technical Details

Return value: numberThe hyperbolic tangent of.
Return type: Float
PHP Version: 4.1+


PHP Math 参考手册PHP Math Reference Manual Other extensions