The math.acosh() method is used to calculate the inverse hyperbolic cosine of a given number.
Syntax
import math
math.acosh(num)
Parameters
num(required): It is a number. The num must be greater than or equal to 1.
Return Value
It returns the inverse hyperbolic cosine of the number in the float datatype.
If num is less than 1 , it returns a ValueError.
If num is not a number , it returns TypeError.
Visual Representation
Example 1: How to Use the math.acosh() Method
import math
# Calculate the inverse hyperbolic cosine of different numbers
print(math.acosh(1))
print(math.acosh(4))
print(math.acosh(7.4))
Output
0.0
2.0634370688955608
2.690030219559707
Example 2: Value is less than 1
import math
print(math.acosh(0))
Output
ValueError: math domain error
Ankit Lathiya is a Master of Computer Application by education and Android and Laravel Developer by profession and one of the authors of this blog. He is also expert in JavaScript and Python development.