atanh
atanh(x)
Compute the inverse hyperbolic tangent of x
Examples
-
Calculate inverse hyperbolic tangent of a number:
julia> atanh(0.5) 0.5493061443340549
This example calculates the inverse hyperbolic tangent of
0.5
using theatanh
function. -
Handle negative input value:
julia> atanh(-0.8) -1.0986122886681098
It correctly calculates the inverse hyperbolic tangent for negative input values.
- Use with arrays:
julia> arr = [0.1, 0.2, 0.3]; julia> atanh.(arr) 3-element Array{Float64,1}: 0.10033534773107562 0.20273255405408225 0.3095196042031118
The
atanh
function can be applied element-wise to an array using the broadcasting syntax.
.
Common mistake example:
julia> atanh("Hello")
ERROR: MethodError: no method matching atanh(::String)
In this example, the atanh
function is being called with a non-numeric argument (String
). Make sure to provide a valid numeric argument to the atanh
function to avoid such errors.
See Also
acos, acosd, acosh, acot, acotd, acoth, acsc, acscd, acsch, asec, asecd, asech, asin, asind, asinh, atan, atan2, atand, atanh, cos, cosc, cosd, cosh, cospi, cot, cotd, coth, csc, cscd, csch, deg2rad, rad2deg, sin, sinc, sind, sinh, sinpi, tan, tand, tanh,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.