Re: Problem with complex numbers

Discussion in 'Python' started by Christian Heimes, Mar 22, 2008.

  1. 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
    Christian Heimes, Mar 22, 2008
    #1
    1. Advertising

  2. On Sat, 22 Mar 2008 23:29:10 +0100, Christian Heimes
    <> 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
    David C. Ullrich, Mar 23, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.amnet.net.au
    Replies:
    1
    Views:
    552
    =?UTF-8?b?TMSByrtpZSBUZWNoaWU=?=
    Apr 13, 2004
  2. Stanimir Stamenkov
    Replies:
    2
    Views:
    715
    Stanimir Stamenkov
    Oct 25, 2005
  3. Robert Mark Bram
    Replies:
    0
    Views:
    666
    Robert Mark Bram
    Feb 4, 2007
  4. vj
    Replies:
    12
    Views:
    905
    Robert W Hand
    Apr 16, 2006
  5. universeee
    Replies:
    0
    Views:
    469
    universeee
    Nov 9, 2008
Loading...

Share This Page