I assume you refer to programming. Classes of complex numbers already exist for many programming languages (for instance, for Java); if you search for them, you can just use the ready-made classes, or - if you have a classroom task of writing your own class - at least get some useful ideas.The general idea is that you define a class with two fields - in Java that would be fields of type "double" - to store the real and imaginary part. Then you define methods for the desired operation and functions, such as addition, subtraction, multiplication, division, sine, cosine, exp, etc.
As an example, to add two numbers, the method "add" can add the number in the object on which it is invoked, and the other number can be passed as a parameter (argument); the answer can be written back to the object. This would be equivalent to:
a = a + b
As an alternative, you can pass two parameters (other complex numbers - i.e., other objects of the type "complex"), and make your object equal to the sum of the two. This would be equivalent to:
a = b + c
Chat with our AI personalities
I found this class that defines complex numbers, and has the capacity of adding them, and much more: http://www.math.ksu.edu/~bennett/jomacg/c.html Basically, you define a class with two fields, one for the real part, and one for the imaginary part.
Complex numbers are a proper superset of real numbers. That is to say, real numbers are a proper subset of complex numbers.
No. Complex numbers is the highest set of numbers you can go, and there are no sets outside of complex numbers.
Real numbers are a proper subset of Complex numbers.
Complex numbers include real numbers, pure imaginary numbers, and the combination of those two.