Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python math.cosh() Method

Python math.cosh() Method

Python math Module Python math Module

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:

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

print

(

math

.

cosh

(

1

)

)

print

(

math

.

cosh

(

8.90

)

)

print

(

math

.

cosh

(

0

)

)

print

(

math

.

cosh

(

1.52

)

)

Output result:


1.5430806348152437
3665.986837772461
1.0
2.395468541047187

Python math Module Python math Module