math.tanh() function

The math.tanh() function returns the hyperbolic tangent of x.

*Output data type: Float*

  1. import "math"
  2. math.tanh(x: 1.23)
  3. // Returns 0.8425793256589296

Parameters

x

The value used in the operation.

*Data type: Float*

Special cases

  1. math.tanh(x: ±0) // Returns ±0
  2. math.tanh(x: ±Inf) // Returns ±1
  3. math.tanh(x: NaN) // Returns NaN