Search w3schools.com:

SHARE THIS PAGE

PHP tanh() Function


PHP Math Reference Complete PHP Math Reference

Definition and Usage

The tanh() function returns the hyperbolic tangent of an angle (equivalent to sinh(x) / cosh(x)).

Syntax

tanh(x)

Parameter Description
x Required. A number


Example

In this example we will get 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))
?>

The output of the code above will be:

0.655794202633
0.46211715726
-0.46211715726
0.999909204263
0.999999995878
-0.999909204263
-0.999999995878


PHP Math Reference Complete PHP Math Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]