Arithmetic/Complex: Difference between revisions

Content added Content deleted
(Link to wp:Imaginary_unit)
Line 1: Line 1:
{{task|Arithmetic operations}}A '''complex number''' is a number which can be written as "a + b*i" (sometimes shown as "b + a*i") where a and b are real numbers and i is the square root of -1. Typically, complex numbers are represented as a pair of real numbers called the "imaginary part" and "real part", where the imaginary part is the number to be multiplied by i.
{{task|Arithmetic operations}}A '''complex number''' is a number which can be written as "a + b*i" (sometimes shown as "b + a*i") where a and b are real numbers and [[wp:Imaginary_unit|i]] is the square root of -1. Typically, complex numbers are represented as a pair of real numbers called the "imaginary part" and "real part", where the imaginary part is the number to be multiplied by i.


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.
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.