Python math.cosh() Method
Python math.cosh(x) Returns the hyperbolic cosine of x, equivalent to (exp(number) + exp(-number)) / 2.
Python version: 1.4
Syntax
The syntax of the math.cosh() method is as follows:
math.cosh(x)
Parameter Description:
- x -- required, a positive or negative number. If x is not a number, a TypeError is returned.
Return Value
Returns a floating-point number representing the hyperbolic cosine of a number.
Example
The following example returns the hyperbolic cosine of different numbers:
Example
Import the math package
import
math
Output the hyperbolic cosine values
(
math
.
cosh
(
1
)
)
(
math
.
cosh
(
8.90
)
)
(
math
.
cosh
(
0
)
)
(
math
.
cosh
(
1.52
)
)
Output result:
1.5430806348152437
3665.986837772461
1.0
2.395468541047187
Python math Module