Thread: Complex Numbers with Visual C++

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    204

    Complex Numbers with Visual C++

    There seems to be a difference between the way complex numbers are handled in GCC and MS Visual C++. In GCC I can access the imaginary and real parts of a number by typing imag(variable) and real(variable) respectively. Is there a similar operation for Visual C++? I can't seem to figure it out. Are complex numbers part of ANSI C++?

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    204
    I think I figured it out. I can manipulate the real and imaginary parts by using the conj function. The functions real and imag can be used to cast to double.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM
  2. header file bringing errors?
    By bluehead in forum Windows Programming
    Replies: 4
    Last Post: 08-19-2003, 12:51 PM
  3. Using 'if' with char arrays or string objects
    By c++_n00b in forum C++ Programming
    Replies: 36
    Last Post: 06-06-2002, 09:04 PM
  4. odd errors from msvc std library files
    By blight2c in forum C++ Programming
    Replies: 6
    Last Post: 04-30-2002, 12:06 AM
  5. Need Help with using complex numbers
    By Rich in forum C++ Programming
    Replies: 2
    Last Post: 09-09-2001, 04:01 PM