Complex Numbers with Visual C++

This is a discussion on Complex Numbers with Visual C++ within the C++ Programming forums, part of the General Programming Boards category; There seems to be a difference between the way complex numbers are handled in GCC and MS Visual C++. In ...

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

    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
    197
    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, 09:57 AM
  2. header file bringing errors?
    By bluehead in forum Windows Programming
    Replies: 4
    Last Post: 08-19-2003, 01: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, 10:04 PM
  4. odd errors from msvc std library files
    By blight2c in forum C++ Programming
    Replies: 6
    Last Post: 04-30-2002, 01:06 AM
  5. Need Help with using complex numbers
    By Rich in forum C++ Programming
    Replies: 2
    Last Post: 09-09-2001, 05:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21