all Python 3cmathfunction
cmath.asinh()
hyperbolic functions
The inverse hyperbolic sine of a complex number. For real numbers it matches math.asinh, but as a complex value.
Syntax
cmath.asinh(z)
asinh has no forbidden region for real numbers, so the only difference from math.asinh is the type: asinh(1) gives (0.881373587019543+0j), and you need .real to get a float. Switching to cmath just in case costs extra .real calls all over the code; use it when the input is really complex.
Examples
import cmath
import math
z = cmath.asinh(1)
print(z) # → (0.881373587019543+0j)
print(z.real == math.asinh(1)) # → True
See also
Open in the full glossarydocs.python.orgReport an inaccuracy