Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

Python – Find Hyperbolic Tangent – tanh() Function with Examples

tanh() function is used to find the the hyperbolic tangent of the given input. Hyperbolic tangent means the analogue of an circular function used throughout trigonometry. This function is a part of python programming language.

 

Syntax of tanh() Function

The syntax of tanh() function in Python is:

 

Parameters of tanh() Function in Python

x – Where x is any valid python number (positive or negative). This parameter is required.
Note: If the x parameter is not a number, tanh() function will return an Error.

 

Compatibility

tanh() function is available and compatible with both Python 2.x and 3.x. This function is a part of python standard math library.

 

Return Value of tanh() Function in Python

tanh() function returns the hyperbolic tangent for the given input (x – parameter).

 

Python tanh() Function Example

Here, we are using different values as an input and finding heir hyperbolic tan.

Output:
-0.09966799462495582
0.0
0.16838104587081473
1.0
-1.0

 

LearnAndLearn.com © 2018 - All rights reserved