Fonction tanh() PHP

Définition et utilisation

La fonction tanh() retourne l'hypertangente.

Syntaxe

tanh(x)
Paramètre Description
x Obligatoire. Un nombre.

Description

Retourne x La valeur hyperbolique tangente, définie par sinh(arg)/cosh(arg).

Exemple

Dans cet exemple, nous allons renvoyer l'hypertangente de différents nombres :

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

Sortie :

0.655794202633
0.46211715726
-0.46211715726
0.999909204263
0.999999995878
-0.999909204263
-0.999999995878