资 源 简 介
The C++ standard library contains a class and a set of functions to handle complex numbers. The std::complex<> class allows to do computation in many fields of science but can be improved in two ways.
The first improvement is the addition of an imaginary number class. In many applications, multiplications of complex numbers with pure imaginary numbers (i.e. a multiple of the imaginary unit sqrt(-1)) occur. Using only the SL class, one has to define these imaginary numbers as a complex number with a 0-valued real pars. The complex multiplication requires 4 real multiplications and 2 real additions whereas the knowledge that the real part of one of the numbers is 0 could reduce this to 2 real multiplications and one negation. The same is true for division and for many other operations. The purpose of this proposal is to implement pure imaginary numbers.
THe second improvement concerns the complex<> class itself. According to the C++ standard, the effect of