Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>real() return real part of a complex number</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 real()                  Return Real Part of a Complex Number

 #include   <complex.h>

 double real(z);
 complex z;     Complex number

        The real() function returns the real part of a complex number.

       Returns:     Real part of the complex number.

   -------------------------------- Example ---------------------------------
        This program prints out the real part of a complex number.

 #include <iostream.h>
 #include <complex.h>

 int main(void)

    double x = 5.3, y = 7.9;
    complex z = complex(x,y);
    cout << "Real part = " << real(z);
    return 0;


See Also: bcd() complex() imag()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson