Go Atanh()
Published Oct 21, 2023
Contribute to Docs
The Atanh() function takes a float64 argument representing the angle whose inverse hyperbolic tangent value is to be returned. It returns this inverse hyperbolic tangent as a float64 value that can range from negative infinity to positive infinity.
Syntax
result := math.Atanh(x)
Where x represents the angle whose inverse hyperbolic tangent value is to be returned, and result is the inverse hyperbolic tangent of x. Some special exceptions include:
Atanh(-1)equals-InfAtanh(1)equals+Inf
Example
The following code calculates the arctangent and prints out the result:
package mainimport ("fmt""math")func main() {fmt.Println(math.Atanh(0.5))fmt.Println(math.Atanh(math.NaN()))}
The output will be:
0.5493061443340548NaN
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 Go 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 how to use Go (Golang), an open-source programming language supported by Google!
- Beginner Friendly.6 hours