cmath.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:ouroboros 作者: pybee 项目源码 文件源码
def acosh(x):
    z = _make_complex(x)

    if abs(z.real) > _LARGE_DOUBLE or abs(z.imag) > _LARGE_DOUBLE:
        return complex(math.log(math.hypot(z.real/2, z.imag/2)) + 2*_LOG_2,
                       math.atan2(z.imag, z.real))

    s1 = sqrt(complex(z.real-1, z.imag))
    s2 = sqrt(complex(z.real+1, z.imag))
    return complex(math.asinh(s1.real*s2.real + s1.imag*s2.imag),
                   2*math.atan2(s1.imag, s2.real))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号