D-Programming-Language/phobos — pull request #1797 by WebDrake (2013-12-20 16:23:08+00:00)
Title: Fix Issue 11787 - std.complex should have a separate Imaginary type.

The rationale for a separate imaginary type has been laid out in Kahan & Thomas, "Augmenting a programming language with complex arithmetic", http://www.eecs.berkeley.edu/Pubs/TechRpts/1992/CSD-92-667.pdf

In total this patch implements:

* The Imaginary type;

* imaginary-numeric operations via Imaginary.opBinary, and numeric-imaginary operations via Imaginary.opBinaryRight

* complex-imaginary operations via Complex.opBinary, and imaginary-complex operations via Complex.opBinaryRight;

* abs and arg implementations to support Imaginary.

A broader range of imaginary-supporting functions (e.g. sin, cos, etc.) are not yet implemented; this will be done conditional on acceptance of the general design.

Issue report: https://d.puremagic.com/issues/show_bug.cgi?id=11787