optimization of complex multiplication as of gcc 4.0.1

Luc Bourhis Luc.Bourhis@durham.ac.uk
Wed Sep 6 16:48:00 GMT 2006


I would like to know whether the multiplication of two complex  
numbers, one of which being actually a real number, e.g.
     std::complex<double> a(1,0);
     std::complex<double> b(1,1.2);
     std::cout << a*b << std::endl;
is optimised to save the trivial multiplications 0*1.2 and 0*1 (in my  
example) and the subsequent addition and subtraction.


Luc Bourhis
Research Assistant
Chemical Crystallography Laboratory
University of Durham, UK



More information about the Libstdc++ mailing list