December 09, 2013 [phobos] [D-Programming-Language/phobos] 8e26e2: Complex.opBinaryRight for numeric types, to allow ... | ||||
---|---|---|---|---|
| ||||
Attachments:
| Branch: refs/heads/master Home: https://github.com/D-Programming-Language/phobos Commit: 8e26e2d8cead244296000edc116a93cfcce3241a https://github.com/D-Programming-Language/phobos/commit/8e26e2d8cead244296000edc116a93cfcce3241a Author: Joseph Rushton Wakeling <joe@webdrake.net> Date: 2013-12-09 (Mon, 09 Dec 2013) Changed paths: M std/complex.d Log Message: ----------- Complex.opBinaryRight for numeric types, to allow numeric ^^ complex operations. 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: return typeof(return)(lhs, 0) ^^ this; This would generate probably less precisely calculated values but would be 100% consistent with complex ^^ complex calculations. Commit: 2de19c7f7b13f63c1d74487ce4063b4283e97eae https://github.com/D-Programming-Language/phobos/commit/2de19c7f7b13f63c1d74487ce4063b4283e97eae Author: monarch dodra <monarchdodra@gmail.com> Date: 2013-12-09 (Mon, 09 Dec 2013) Changed paths: M std/complex.d Log Message: ----------- Merge pull request #1740 from WebDrake/numeric-op-complex Fix Issue 11652: support numerical ^^ complex operations in std.complex Compare: https://github.com/D-Programming-Language/phobos/compare/624499f0487b...2de19c7f7b13 |
Copyright © 1999-2021 by the D Language Foundation