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

13 lines
253 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
x=: 1j1
y=: 3.14159j1.2
2016-12-05 22:15:40 +01:00
x+y NB. addition
2013-04-10 21:29:02 -07:00
4.14159j2.2
2016-12-05 22:15:40 +01:00
x*y NB. multiplication
2013-04-10 21:29:02 -07:00
1.94159j4.34159
2016-12-05 22:15:40 +01:00
%x NB. inversion
2013-04-10 21:29:02 -07:00
0.5j_0.5
2016-12-05 22:15:40 +01:00
-x NB. negation
2013-04-10 21:29:02 -07:00
_1j_1
2016-12-05 22:15:40 +01:00
+x NB. (complex) conjugation
1j_1