⊕
⊖
Contents
Python math.tanh()
math.tanh(x) function returns the hyperbolic tangent of x.
tanh(x) = (e^2x – 1)/(e^2x + 1)
Syntax
The syntax to call tanh() function is
math.tanh(x)
where
Parameter | Required | Description |
---|---|---|
x | Yes | A numeric value. |
Examples
In the following example, we find the hyperbolic tangent of 5, using tanh() function of math module.
Output
tanh(x) : 0.9999092042625951
Summary
In this Python Examples tutorial, we learned the syntax of, and examples for math.tanh() function.