RosettaCodeData/Task/Arithmetic-Complex/00DESCRIPTION

25 lines
1.2 KiB
Plaintext

A   '''[[wp:Complex number|complex number]]'''   is a number which can be written as:
<big><math>a + b \times i</math></big>
(sometimes shown as:
<big><math>b + a \times i</math></big>
where &nbsp; <big><math>a</math></big> &nbsp; and &nbsp; <big><math>b</math></big>&nbsp; are real numbers, &nbsp; and &nbsp; [[wp:Imaginary_unit|<big><math>i</math></big>]] &nbsp; is &nbsp; <big>&radic;{{overline|&nbsp;-1&nbsp;}}</big>
Typically, complex numbers are represented as a pair of real numbers called the "imaginary part" and "real part", &nbsp; where the imaginary part is the number to be multiplied by <big><math>i</math></big>.
;Task:
* Show addition, multiplication, negation, and inversion of complex numbers in separate functions. (Subtraction and division operations can be made with pairs of these operations.)
* Print the results for each operation tested.
* ''Optional:'' Show complex conjugation.
<br>
By definition, the &nbsp; [[wp:complex conjugate|complex conjugate]] &nbsp; of
<big><math>a + bi</math></big>
is
<big><math>a - bi</math></big>
<br>
Some languages have complex number libraries available. &nbsp; If your language does, show the operations. &nbsp; If your language does not, also show the definition of this type.
<br><br>