C++ Operator Classes: Real & Imaginary Numbers Explained

  • Context: C/C++ 
  • Thread starter Thread starter asma_MIT
  • Start date Start date
  • Tags Tags
    C++ Classes Operator
Click For Summary

Discussion Overview

The discussion centers around the understanding of real and imaginary numbers in the context of C++ operator overloading and class definitions. Participants explore the mathematical concepts behind complex numbers and their relevance to programming.

Discussion Character

  • Conceptual clarification
  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant expresses confusion about the definition of real and imaginary numbers in C++ classes and seeks clarification.
  • Another participant asserts that the question is fundamentally a mathematical one rather than a programming issue.
  • A participant acknowledges the mathematical nature of the question but emphasizes its relevance to programming.
  • Discussion includes references to the C++ TR1 standard and C++0x, which propose complex number classes, suggesting that these may provide useful tools for handling such numbers in programming.
  • Complex numbers are described as having the form c = a + id, where a is the real part and d is the imaginary part, with i representing the square root of -1.
  • One participant notes the importance of complex numbers in various mathematical functions, indicating their structured representation in programming as pairs of floating-point numbers.
  • There is a mention of a previous response being perceived as unhelpful, leading to an apology from the original poster.

Areas of Agreement / Disagreement

Participants generally agree that the question involves both mathematical and programming aspects, but there is contention regarding the framing of the question as purely mathematical. The discussion remains unresolved regarding the best way to approach the topic.

Contextual Notes

Some participants indicate that the understanding of real and imaginary numbers may depend on definitions and context, and there are unresolved aspects regarding how these concepts translate into C++ programming.

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 22 ·
Replies
22
Views
3K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
4K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 31 ·
2
Replies
31
Views
3K