Run Code | API | Code Wall | Misc | Feedback | Login | Theme | Privacy | Patreon |
Arithmetic operator overloading member function for Complex number cla...==== [EXPERIMENT 1] ============== c1 = Complex{ 0 + 0j } ; c2 = Complex{ 2 + 5j } ; c3 = Complex{ 3 + 4j } ==== [EXPERIMENT 2] ============== -(c2 + c3) = Complex{ -5 + -9j } c2 + c2 = Complex{ 5 + 9j } r1.Real() = 5 ; r1.Imag() = 9 4 * (c1 + c2 + c3) = Complex{ 20 + 36j } (c2 * c3 - c1) = Complex{ -14 + 23j } (c2 / c3) * 25 = Complex{ 26 + 7j } ==== [EXPERIMENT 3] ============== abs(c2) = 5.38516 |
λ
.NET NoSQL database for rapid development
|