Arithmetic/Complex: Difference between revisions

Content added Content deleted
m (→‎{{header|J}}: Add lang tags)
Line 830: Line 830:
=={{header|J}}==
=={{header|J}}==
Complex numbers are a native numeric data type in J. Although the examples shown here are performed on scalars, all numeric operations naturally apply to arrays of complex numbers.
Complex numbers are a native numeric data type in J. Although the examples shown here are performed on scalars, all numeric operations naturally apply to arrays of complex numbers.
x=: 1j1
<lang j> x=: 1j1
y=: 3.14159j1.2
y=: 3.14159j1.2
x+y
x+y
4.14159j2.2
4.14159j2.2
x*y
x*y
1.94159j4.34159
1.94159j4.34159
%x
%x
0.5j_0.5
0.5j_0.5
-x
-x
_1j_1
_1j_1
</lang>


=={{header|Java}}==
=={{header|Java}}==