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:
";
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.99999999587769Laravel 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.