minor bug in cmath.asin?

Edwin Young edwin at localhost.localdomain
Sun Apr 4 00:42:43 EST 2004


Erik Max Francis <max at alcyone.com> writes:

> Edwin Young wrote:
> 
> > It's not clear if the leading - sign affects the entire expression or
> > indicates that i is negative. Python's implementation uses the former
> > - I argue that the latter is more correct.
> 
> What's the difference?  Multiplication on complex numbers is
> commutative.

Floating point math is weird. Among its oddities it has a positive
zero and a negative zero. The way Python implements asin, it produces
-0 in some circumstances when it should ideally produce +0, because it
multiples by (-0-1j) rather than (+0-1j). This in turn is because both
parts of the expression are negated, not just the imaginary part.

--
Edwin



More information about the Python-list mailing list