Results 1 to 5 of 5

Thread: Modulo of complex numbers

  1. #1
    New Member
    Join Date
    Jul 2012
    Location
    Michigan
    Posts
    8

    Modulo of complex numbers

    Hello,
    I am familiar with the modulo (division remainder) operator on real numbers, but I am needing to implement (in software) modulo on complex numbers, and am wondering if there is a general, universally accepted method for getting the same thing, and if so, what it is.
    If you want to begin to understand me, try this:
    1+1 = 2; 10 + 10 = 4; 2 + 2 = 11

  2. #2
    Full Member
    Join Date
    Aug 2011
    Posts
    989
    Nonzero complex numbers always divide evenly into each other. By "evenly" of course I mean for any complex x and y (y not 0) there always exists a unique complex number z such that zy=x. This is true of any field. So the remainder is always zero...

    If you mean the Gaussian Integers, you'll first need to define your norm. Typically |x+iy| = sqrt(x^2+y^2). Then if a+bi and x+iy are Gaussian Integers, then there always exists unique r,q in Z[i] such that (a+bi) = (x+yi)*q + r, where 0<= |r| < |x+yi|. See here for the division algorithm: http://fermatslasttheorem.blogspot.c...-gaussian.html
    Last edited by daon2; 07-07-2012 at 03:46 AM.

  3. #3
    New Member
    Join Date
    Jul 2012
    Location
    Michigan
    Posts
    8
    Interesting. I went to WolframAlpha, and entered "(6+4i)mod(3+5i)" and was given the answer "-2+2i." Assuming what you said to be true, I don't know how that answer was generated, but it is more like what I am looking for than 0 for any complex number.

    To explain why I ask this, I am writing a calculator. It uses postfix notation, and operates on arbitrary precision complex numbers. One of the operations that is defined is modulus, and I would like it to work for all inputs, rather than just all real inputs. Since WolframAlpha does not tell me how it arrived at it's result, I can only hope that someone here can.
    If you want to begin to understand me, try this:
    1+1 = 2; 10 + 10 = 4; 2 + 2 = 11

  4. #4
    Elite Member
    Join Date
    Jun 2007
    Posts
    17,017
    I think the problem is that the MOD operation is only defined in Integer field. If you consider all the real numbers - then there is no residue. Similar situation is in complex field. Now if you restrict the field such that (a,b) are integers only, then you'll get modulo result.
    Last edited by mmm4444bot; 07-07-2012 at 12:15 PM.
    “... mathematics is only the art of saying the same thing in different words” - B. Russell

  5. #5
    New Member
    Join Date
    Jul 2012
    Location
    Michigan
    Posts
    8
    I have seen mod extended to support all real numbers, and WolframAlpha will compute it for all complex numbers as well. As I have seen it in software, the modulus of non-integer real numbers a and b is something like a-floor(a/b)*b.

    Actually, now that I look at the extended list of alternate representations, it appears that WolframAlpha uses the method that I saw in software.
    Last edited by erroneum; 07-07-2012 at 03:55 PM.
    If you want to begin to understand me, try this:
    1+1 = 2; 10 + 10 = 4; 2 + 2 = 11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •