Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: Problem with complex numbers (http://www.velocityreviews.com/forums/t600963-re-problem-with-complex-numbers.html)

 Christian Heimes 03-22-2008 10:29 PM

Re: Problem with complex numbers

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

Christian

 David C. Ullrich 03-23-2008 02:25 PM

Re: Problem with complex numbers

On Sat, 22 Mar 2008 23:29:10 +0100, Christian Heimes
<lists@cheimes.de> 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...

Thanks.

>Christian

David C. Ullrich

 All times are GMT. The time now is 12:37 PM.