numpy.emath.arctanh#

emath.arctanh(x)[源代码]#

计算 x 的反双曲正切.

返回 arctanh(x) 的“主值”(有关此的描述,请参见 numpy.arctanh ).对于满足 abs(x) < 1 的实数 x ,这是一个实数.如果 abs(x) > 1 ,或者如果 x 是复数,则结果是复数.最后, x = 1 返回 inf ,而 x=-1 返回 -inf .

参数:
xarray_like

需要计算反双曲正切的值.

返回:
outndarray 或标量

x 值的反双曲正切.如果 x 是标量,则 out 也是标量,否则返回一个数组.

参见

numpy.arctanh

注释

对于当实数 x 不在区间 (-1,1) 中时返回 NAN 的 arctanh(),请使用 numpy.arctanh (但是,后者确实为 x = +/-1 返回 +/-inf).

示例

>>> import numpy as np
>>> np.set_printoptions(precision=4)
>>> np.emath.arctanh(0.5)
0.5493061443340549
>>> from numpy.testing import suppress_warnings
>>> with suppress_warnings() as sup:
...     sup.filter(RuntimeWarning)
...     np.emath.arctanh(np.eye(2))
array([[inf,  0.],
       [ 0., inf]])
>>> np.emath.arctanh([1j])
array([0.+0.7854j])