Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
complex.cpp
Go to the documentation of this file.
1
29#include <complex> // for complex
30#include <iostream> // for cout, endl
31#include <sstream> // for sstream
32
33#include <examples.h>
34
35int main ()
36{
37 // Create two arbitrary complex numbers.
38 std::complex<double> a (1.2, 3.4);
39 std::complex<double> b (-9.8, -7.6);
40
41 // Perform some arithmetic on the numbers.
42 a += b;
43 a /= std::sin (b) * std::cos (a);
44 b *= std::log (a) + std::pow (b, a);
45
46 // Output result in fixed notation.
47 std::cout.setf (std::ios::fixed, std::ios::floatfield);
48 std::cout << "a = " << a << ", b = " << b << std::endl;
49
50 return 0;
51}
#define a
Definition 17.names.cpp:109
#define b
Definition 17.names.cpp:110
int main()
Definition complex.cpp:35