Arithmetic/Complex: Difference between revisions

Added 11l
(The Futhark example is incorrect.)
(Added 11l)
Line 25:
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.
<br><br>
 
=={{header|11l}}==
{{trans|Python}}
 
<lang 11l>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)</lang>
 
{{out}}
<pre>
3+4.5i
1.5i
-2.25+6.75i
1.5+0.5i
-1.5-3i
1.5-3i
3.3541
-1.10248-0.383064i
1.5
3
</pre>
 
=={{header|Ada}}==
1,481

edits