Home >>Python math Module >Python math.cosh() Method

Python math.cosh() Method

Python math.cosh() Method

Python math.cosh() Method in python is used to returns hyperbolic cosine of a number and it accepts a number.

Syntax:
math.cosh(x)

Parameter Values

Parameter Description
x It is required a number to find the hyperbolic cosine, it returns a TypeError
Let’s take an example of Python math.cosh() Method:

import math
print (math.cosh(-2))
print (math.cosh(6.23))
print (math.cosh(3.76))
print (math.cosh(0))

Output:
3.7621956910836314
253.87872647384526
21.485854859568956
1.0
Example 2:

import math 
x = -54
print("math.cosh(",x,"): ", math.cosh(x))
x = -4.3
print("math.cosh(",x,"): ", math.cosh(x))
x = 0
print("math.cosh(",x,"): ", math.cosh(x))
x = 2
print("math.cosh(",x,"): ", math.cosh(x))
x = 12.27
print("math.cosh(",x,"): ", math.cosh(x))

Output:
math.cosh( -54 ): 1.415376651637347e+23
math.cosh( -4.3 ): 36.85668112930399
math.cosh( 0 ): 1.0
math.cosh( 2 ): 3.7621956910836314
math.cosh( 12.27 ): 106601.495475045

No Sidebar ads