Math Functions

math.tanh()

Compute hyperbolic tangent, whose exact finite-real range lies between -1 and 1. Rounded values may reach the endpoints.

Formal Syntax & Structure

python syntaxpython
math.tanh(x, /)

Parameters & Attributes

NameTypeDescription
xreal numberInput real value.

Return Value

float

Floating-point result; finite precision and domain restrictions apply.

Working Example

Example Snippetpython
import mathprint(math.tanh(0))
Python Reference