Jump to content

Arithmetic/Complex: Difference between revisions

→‎{{header|C++}}: The example didn't output
(+ Pascal)
(→‎{{header|C++}}: The example didn't output)
Line 180:
=={{header|C++}}==
<cpp>
#include <iostream>
#include <complex>
using std::complex;
Line 186 ⟶ 187:
complex<double> a(1.0, 1.0);
complex<double> b(3.14159, 1.25);
 
complex<double> c;
 
// addition
cstd::cout =<< a + b << std::endl;
// multiplication
cstd::cout =<< a * b << std::endl;
// inversion
cstd::cout =<< 1.0 / a << std::endl;
// negation
cstd::cout =<< -a << std::endl;
}
</cpp>
973

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.