RosettaCodeData/Task/Arithmetic-Complex/J/arithmetic-complex.j

13 lines
253 B
Plaintext

x=: 1j1
y=: 3.14159j1.2
x+y NB. addition
4.14159j2.2
x*y NB. multiplication
1.94159j4.34159
%x NB. inversion
0.5j_0.5
-x NB. negation
_1j_1
+x NB. (complex) conjugation
1j_1