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.
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:
<?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 script outputs the following values respectively:
0.65579420263267
0.46211715726001
-0.46211715726001
0.9999092042626
0.99999999587769
-0.9999092042626
-0.99999999587769Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
