Re: Problem with complex numbers

2008-03-23 Thread David C. Ullrich
On Sat, 22 Mar 2008 23:29:10 +0100, Christian Heimes
[EMAIL PROTECTED] wrote:

Matthias Götz schrieb:
 So can you tell me what's the purpose of Complex.py,
 
 and where can i find the semantic i'am looking for.

Well, the file is in the Demo folder. It's just a demo how to implement
a naive complex type in Python.

Why do you think the power of a complex to a complex is not defined?
Raising a complex to a complex power is well defined, 

Really? One of the problems that used to show up on the master's
exams aroung here was to find all the possible values of i**i.

although the
mathematical proof isn't trivial. You have to use the Euler form. 

Erm, the problem is that the Euler form of a complex number is
not well-defined (_unless_ you specify that the argument is
between -pi and pi). For example, i = exp(i pi/2) and also
i = exp(i 5*pi/2); those two forms give different values for i**i.

You might say that a complex power of an Euler form for a
complex number is well-defined.

If you do specify that -pi  argument = pi, ie you consider
the principal-value logarithm, then you get exactly one z**w.
But that's not always the z**w that you need for your problem...

Ask
Google for some examples

Thanks.

Christian

David C. Ullrich
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem with complex numbers

2008-03-22 Thread Christian Heimes
Matthias Götz schrieb:
 So if somebody can help me, it would be nice. Thanks.

The complex type is implemented in C. It's totally unrelated to Complex.py.

Christian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem with complex numbers

2008-03-22 Thread Christian Heimes
Matthias Götz schrieb:
 So can you tell me what's the purpose of Complex.py,
 
 and where can i find the semantic i'am looking for.

Well, the file is in the Demo folder. It's just a demo how to implement
a naive complex type in Python.

Why do you think the power of a complex to a complex is not defined?
Raising a complex to a complex power is well defined, although the
mathematical proof isn't trivial. You have to use the Euler form. Ask
Google for some examples

Christian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem with complex numbers

2008-03-22 Thread Terry Reedy

Christian Heimes [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

| Well, the file is in the Demo folder. It's just a demo how to implement
a naive complex type in Python.

| Why do you think the power of a complex to a complex is not defined?

I suspect because the naive implementation raise TypeError for that case. 



-- 
http://mail.python.org/mailman/listinfo/python-list