Python math.acosh() Method

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

Visual Representation of Python math.acosh() Method

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 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.