cmath module errata

Nadav Horesh nadavh at envision.co.il
Thu Sep 7 18:18:47 CEST 2000


The functions cmath.asinh and cmath.acosh behavior is erratic (at least
at Python versions <= 1.6)

For correct results use the following definitions:

sq05=cmath.sqrt(0.5)
def asinh(x):
    return 2*cmath.log(sq05*(cmath.sqrt(x+1j)+cmath.sqrt(x-1j)))

def acosh(x):
   return 2*cmath.log(sq05*(cmath.sqrt(x+1.0)+cmath.sqrt(x-1.0)))

    Nadav.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nadavh.vcf
Type: text/x-vcard
Size: 360 bytes
Desc: Card for Nadav Horesh
URL: <http://mail.python.org/pipermail/python-list/attachments/20000907/06a2945d/attachment.vcf>


More information about the Python-list mailing list