math.acosh()

Anonymous contributor's avatar
Anonymous contributor
Published Aug 28, 2024
Contribute to Docs

In Python, the math.acosh() function returns the inverse hyperbolic cosine (also known as the hyperbolic arccosine) of a given number.

Syntax

math.acosh(x)
  • x: The value for which the inverse hyperbolic cosine is to be computed. It must be a real number greater than or equal to 1.

Example

The example below uses the math.acosh() function to return the hyperbolic arccosine of the specified numbers:

import math
# Hyperbolic arccosine of 1
print(math.acosh(1))
# Hyperbolic arccosine of 2
print(math.acosh(2))
# Hyperbolic arccosine of 10.5
print(math.acosh(10.5))

The output for the above code is:

0.0
1.3169578969248166
3.0422471120933285

Note: If the input value is less than 1, the function will return a ValueError.

Codebyte Example

The following codebyte example demonstrates how the math.acosh() function works:

Code
Output
Loading...

All contributors

Contribute to Docs

Learn Python on Codecademy