How to resolve the algorithm Arithmetic/Complex step by step in the 11l programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Arithmetic/Complex step by step in the 11l programming language
Table of Contents
Problem Statement
A complex number is a number which can be written as:
a + b × i
{\displaystyle a+b\times i}
(sometimes shown as:
b + a × i
{\displaystyle b+a\times i}
where
a
{\displaystyle a}
and
b
{\displaystyle b}
are real numbers, and
i
{\displaystyle i}
is √ -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
{\displaystyle i}
.
By definition, the complex conjugate of
a + b i
{\displaystyle a+bi}
is
a − b i
{\displaystyle a-bi}
Some languages have complex number libraries available. If your language does, show the operations. If your language does not, also show the definition of this type.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Arithmetic/Complex step by step in the 11l programming language
Source code in the 11l programming language
V z1 = 1.5 + 3i
V z2 = 1.5 + 1.5i
print(z1 + z2)
print(z1 - z2)
print(z1 * z2)
print(z1 / z2)
print(-z1)
print(conjugate(z1))
print(abs(z1))
print(z1 ^ z2)
print(z1.real)
print(z1.imag)
You may also check:How to resolve the algorithm Look-and-say sequence step by step in the Fennel programming language
You may also check:How to resolve the algorithm UTF-8 encode and decode step by step in the Raku programming language
You may also check:How to resolve the algorithm Execute Brain step by step in the PL/M programming language
You may also check:How to resolve the algorithm Thue-Morse step by step in the Delphi programming language
You may also check:How to resolve the algorithm Reverse words in a string step by step in the Gema programming language