Overview
Examples
Screenshots
Comparisons
Applications
Download
Manual
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Language
English











SourceForge.net Logo



Complex

 

Using U++ complex number class (derived from std::complex)

 

 

Complex.cpp

 

#include <Core/Core.h>

 

using namespace Upp;

 

CONSOLE_APP_MAIN{

    Complex a(1,2);

    Cout() << "a = " << a << "\n";

    Cout() << "Im(a) = " << a.imag() << "\n";

    Cout() << "Re(a) = " << a.real() << "\n";

    Cout() << "|a| = " << abs(a) << "\n";

    Cout() << "a+a = " << a+a << "\n";

    Cout() << "2a = " << 2.0*a << "\n";

    Cout() << "a^2 = " << a*a << "\n";

}

 

 

 

 

 

 

This page is also in català, čeština, deutsch, español, euskara, français, română, русский, 中文(简体) and 中文(繁體). Do you want to contribute?