answersLogoWhite

0

How do you instantiate a complex number?

Updated: 10/12/2022
User Avatar

Tintymon

Lvl 1
7y ago

Best Answer

The following are the different ways to assign a value to a complex number:

By passing two Double values to its constructor. The first value represents the real, and the second value represents imaginary part of a complex number.

For example,

Complex c1 = new Complex(5, 8); /* It represents (5, 8) */
By assigning a Byte, SByte, Intl6, UIntl6, Int32, UInt32, Int64, UInt64, Single, or Double value to aComplex object. The assigned value represents the real part of the complex number, and its imaginary part becomes0. For example,
Complex c2 = 15.3; /* It represents (15.3, 0) */
By casting a Decimal or BigInteger value to a Complex object.
For example,
Complex c3 = (Complex) 14.7; /* It represents (14.7, 0) */
Assigning the value returned by an operator to a Complex variable.
For example,
Complex c4 = c1 + c2; /* It represents (20.3, 8) */
User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you instantiate a complex number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you instantiate an abstract class?

No. You must create a subclass of the abstract class in order to be able to instantiate it.


How do you declare a pointer variable in c?

int* pint; // instantiate a pointer to an int. float* pflt; // instantiate a pointer to a float.


What is a good explanation of instantiate?

The term 'instantiate' can be used in many different ways. The word 'instantiate' is a term meaning to provide an example. One way an individual might use the term is 'The mom instantiated how to tie her shoe.'


Solve 7-24i complex number?

31


Adjoint operator of a complex number?

Adjoint operator of a complex number?


What is another name for absolute value of a complex number?

The absolute value of a complex number is the magnitude of the number, which is found from sqrt(a² + b²) for the complex number a + bi


Can a complex number be a pure imaginary number?

Yes. And since Real numbers are a subset of complex numbers, a complex number can also be a pure real.Another AnswerYes, for example: (0 + j5) is a complex number, whose 'real' number is zero.


What do you get if you raise a real number to a complex number?

You get a complex number unless the real number happens to be 0 or 1.


What is the graphical relationship between a conjugate number and a complex number?

Graphically, the conjugate of a complex number is its reflection on the real axis.


Are imaginary and complex numbers the same?

No. A complex number is a number that has both a real part and an imaginary part. Technically, a pure imaginary number ... which has no real part ... is not a complex number.


Is 3i an irrational number?

No. It is an imaginary (or complex) number.


Can you instantiate an interface?

According to a beginner's book on Java, an interface can't have constructors. Also, the interface itself can't contain the method implementation.