Logo

Programming-Idioms

History of Idiom 77 > diff from v19 to v20

Edit summary for version 20 by fantasy:
New Cpp implementation by user [fantasy]

Version 19

2018-04-09, 15:19:40

Version 20

2018-05-08, 01:57:44

Idiom #77 Complex number

Declare a complex x and initialize it with value (3i - 2). Then multiply it by i.

Illustration

Idiom #77 Complex number

Declare a complex x and initialize it with value (3i - 2). Then multiply it by i.

Illustration
Imports
#include <complex>
Code
using namespace std::complex_literals;
	
auto x = 3i - 2.;
x *= 1i;