math.atanh()
Published Sep 11, 2024
Contribute to Docs
In Python, the math.atanh()
function returns the inverse hyperbolic tangent of a number.
Syntax
math.atanh(x)
Since it is used to reverse the effect of a hyperbolic tangent function, the parameter x
must always a number between -0.99 and 0.99. A ValueError
will occur if:
x
is greater than or equal to 1.x
is less than or equal to -1.
Example
The following example shows the use of the math.atanh()
:
import mathx = 0.5result = math.atanh(x)print("Inverse hyperbolic tangent of 0.5 =",str(result))
The above code produces the following output:
Inverse hyperbolic tangent of 0.5 = 0.5493061443340549
Codebyte Example
Run the following code to understand how the math.atanh()
function works:
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.