minor bug in cmath.asin?

Erik Max Francis max at alcyone.com
Sat Apr 3 23:58:52 EST 2004


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.

> I've also noticed that cmath.acos has the same issue, and that the
> formula used for cmath.asinh is not quite accurate around 0 :
> cmath.asinh(0) gives 4.44089e-16+0j, rather than 0 as expected.

Remember that these transcendental functions are usually computed by
approxmation.  So it's not all that surprising that sin(0) isn't exactly
0.

-- 
 __ Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
/  \ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
\__/ Sit loosely in the saddle of life.
    -- Robert Louis Stevenson



More information about the Python-list mailing list