C examples for complex.h:real
public member function
<complex> <complex.h>
T real() const; void real (T val);
Returns the real part of the complex number.
none
The real part.
#include <iostream> // std::cout #include <complex> // std::complex int main ()//from ww w . j a v a 2 s.c o m { std::complex<double> mycomplex (10.0,1.0); std::cout << "Real part: " << mycomplex.real() << '\n'; return 0; }