C/C++ C++ Operator Classes: Real & Imaginary Numbers Explained

AI Thread Summary
The discussion centers around the confusion regarding real and imaginary numbers in the context of C++ programming, particularly when defining operators for complex numbers. Real numbers are represented as the 'a' component, while imaginary numbers are represented as the 'd' component in the expression c = a + id, where 'i' denotes the imaginary unit (the square root of -1). The conversation highlights that while the question has mathematical roots, it is relevant to programming, especially with the introduction of complex number classes in the C++ TR1 standard and proposed C++0x. Complex numbers are essential for various mathematical functions, and they can be represented in programming as pairs of floating-point numbers. The discussion also touches on the importance of respectful communication in forums, as initial responses included some misunderstandings and aggressive tones. Ultimately, the original poster expresses gratitude for the clarification received.
asma_MIT
Messages
6
Reaction score
0
i don't clearly understand that what are the real and imaginary numbers in c++ classes when defining operators. help me .
thnx
 
Last edited by a moderator:
Technology news on Phys.org
<< aggressive response deleted by berkeman >>
 
Last edited by a moderator:
Yes, this is a math question. Real and imaginary numbers are not part of C++, classes and operators are.
 
its true its math problem but in programming it is related now i want to know what are the real n imaginary numbers.
if i say c=a+d
then a is real n d is imaginary number what does it mean...
thnx if u will tell
 
The new c++ TR1 standard and the proposed C++0x have complex number classes, you should check if your compiler supports them.

edit: in your example c would be a complex number, it's normally written c = a +id
 
I have posted link to an explanation.
 
what a lovely answer it is...
but its true that its not helpful for me.
thnx 4 ur reply..
i take my question back no can answer.....
 
As mgb_phys posted a complex number is a number of the form c = a + id. As the link that Borek posted indicates in the a+di form a and d are real numbers and i is the imaginary number (the square root of -1). Here a is called the real part of c and d is called the imaginary part of c.

Complex numbers are important for many mathematical functions such as solving roots of polynomials, transcendental functions, etc. They can be easily represented programmatically as a named pair of floating point numbers representing the real part and the imaginary part, so they form a kind of prototypical example of a structured data type.

Your reply to Borek was not very polite. He correctly identified your question and pointed you to a good site to fully answer it. He did not deserve to be replied to in that fashion.
 
  • #10
soorrry Borek
now i understand the answer thnx actually i was in tention so sorry 4 that attitude
 

Similar threads

Replies
23
Views
2K
Replies
5
Views
3K
Replies
8
Views
2K
Replies
34
Views
4K
Replies
22
Views
3K
Replies
31
Views
3K
Back
Top