Backend Development 2 min read

PHP tanh() Function – Hyperbolic Tangent

The PHP tanh() function returns the hyperbolic tangent of a float argument, defined as sinh(arg)/cosh(arg), and the article explains its signature, parameters, return value, provides example code snippets, and shows the resulting output values.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
PHP tanh() Function – Hyperbolic Tangent

The tanh() function in PHP returns the hyperbolic tangent of a given float argument, defined as sinh(arg)/cosh(arg).

Signature: float tanh(float $arg)

Parameter: $arg – the value to be processed.

Return value: The hyperbolic tangent of $arg as a float.

Example usage:

";
echo tanh(0.50)."
";
echo tanh(-0.50)."
";
echo tanh(5)."
";
echo tanh(10)."
";
echo tanh(-5)."
";
echo tanh(-10);
?>

The script outputs the following values respectively:

0.65579420263267
0.46211715726001
-0.46211715726001
0.9999092042626
0.99999999587769
-0.9999092042626
-0.99999999587769
backendphpExamplehyperbolic tangentmath functiontanh
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.