std.complex
Module that will replace the built-in types cfloat, cdouble, creal, ifloat, idouble, and ireal. Author:Andrei Alexandrescu
- Representation choices for the Complex type. Cartesian representation is better when using additive operations and when real and imaginary part are to be manipulated separately. Polar representation is more advantageous when using multiplicative operations and when modulus and angle are to be manipulated separately.
- Complex type parameterized with the numeric type (e.g. float, double, or real) and the representation.
- Gets the real component of the number. Might involve a calculation, subject to representation. Use x.re to statically enforce Cartesian representation.
- Gets the imaginary component of the number. Might involve a calculation, subject to representation. Use x.im to statically enforce Cartesian representation.
- Gets the modulus of the number. Might involve a calculation, subject to representation. Use x.modulus to statically enforce polar representation.
- Gets the angle of the number. Might involve a calculation, subject to representation. Use x.angle to statically enforce polar representation.