D-Programming-Language/phobos — pull request #1740 by WebDrake (2013-12-01 11:14:06+00:00)
Title: Fix Issue 11652: support numerical ^^ complex operations in std.complex

This patch adds a Complex.opBinaryRight method for `op == "^^"` and numeric LHS.

The current design takes advantage of the fact that we know we're dealing with a number whose argument is either 0 or PI. An alternative design would be to just create a complex number whose real part is equal to the input, and then raise it to the power of this:

```D
return typeof(return)(lhs, 0) ^^ this;
```

This would generate probably less precisely calculated values but would be 100% consistent with complex ^^ complex calculations. I leave the choice here up to review. :-)