Home >>Python cmath Module >Python cmath.tanh() Method

Python cmath.tanh() Method

Python cmath.tanh() Method

Python cmath.tanh() method is used to returns a complex number with the hyperbolic tangent.

Syntax:
cmath.tanh(x)

Parameter Values

Parameter Description
x It is a required parameter to find the hyperbolic tangent of a number. It returns a TypeError If the value is not a number.
Here is an example of Python cmath.tanh() Method:

import cmath 
print (cmath.tanh(1 + 3j))

Output:
(0.768017647286911-0.05916853956605073j)
Example 2:

import cmath 
print (cmath.tanh(3 + 4j))

Output:
(1.000709536067233+0.00490825806749606j)