This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients christian.heimes, mark.dickinson, thor222
Date 2008-10-17.17:00:19
SpamBayes Score 2.7157197e-08
Marked as misclassified No
Message-id <1224262821.14.0.991623366565.issue4139@psf.upfronthosting.co.za>
In-reply-to
Content
This is not a bug, at least in the sense that the behaviour of Python 
2.6 is intentional:  asin has branch cuts from 1 to infinity and -1 to -
infinity along the real axis.  As explained by the note at the top of 
the cmath documentation, on platforms with signed zeros (which is pretty 
much all platforms these days), the sign of the imaginary part of the 
argument is used to determine which side of the branch cut to use.  So:

>>> import cmath
>>> cmath.asin(complex(2.0, 0.0))
(1.5707963267948966+1.3169578969248166j)
>>> cmath.asin(complex(2.0, -0.0))
(1.5707963267948966-1.3169578969248166j)

This is fairly standard practice, and usually the right thing in 
applications;  see the Kahan paper referred to at the bottom of the 
cmath docs.  It also follows the suggestions outlined in Annex G of the 
C99 standard.
History
Date User Action Args
2008-10-17 17:00:21mark.dickinsonsetrecipients: + mark.dickinson, christian.heimes, thor222
2008-10-17 17:00:21mark.dickinsonsetmessageid: <1224262821.14.0.991623366565.issue4139@psf.upfronthosting.co.za>
2008-10-17 17:00:20mark.dickinsonlinkissue4139 messages
2008-10-17 17:00:19mark.dickinsoncreate