Python 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:
xis greater than or equal to 1.xis 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.
Learn Python on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours
- Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today.
- With Certificate
- Beginner Friendly.24 hours