Python math.tanh() Method
Example
Find the hyperbolic tangent of different numbers:
# Import math Library
import math
# Return the hyperbolic tangent of
different numbers
print(math.tanh(8))
print(math.tanh(1))
print(math.tanh(-6.2))
Try it Yourself »
Definition and Usage
The math.tanh()
method returns the hyperbolic tangent of a number.
Syntax
math.tanh(x)
Parameter Values
Parameter | Description |
---|---|
x | Required. A number to find the hyperbolic tangent of. If the value is not a number, it returns a TypeError |
Technical Details
Return Value: | A float value, representing the
hyperbolic tangent of a number |
---|---|
Python Version: | 1.4 |
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.