Bug 11652 – Support numerical ^^ complex operations in std.complex

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-30T08:42:00Z
Last change time
2013-12-09T10:00:33Z
Assigned to
nobody
Creator
joseph.wakeling

Comments

Comment #0 by joseph.wakeling — 2013-11-30T08:42:53Z
std.complex supports exponentiation of the form complex ^^ numeric but lacks support for numeric ^^ complex. Example: auto rec = 2.0 ^^ complex(1.1, 2.2); results in Error: incompatible types for ((2.00000) ^^ (complex(1.1, 2.2))): 'double' and 'Complex!double'
Comment #1 by joseph.wakeling — 2013-11-30T08:43:48Z
This is fairly easy to fix -- just add an opBinaryRight for numeric LHS with op == "^^". I'll submit a patch shortly.
Comment #2 by joseph.wakeling — 2013-12-01T03:14:56Z
Comment #3 by github-bugzilla — 2013-12-09T09:28:23Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/2de19c7f7b13f63c1d74487ce4063b4283e97eae Merge pull request #1740 from WebDrake/numeric-op-complex Fix Issue 11652: support numerical ^^ complex operations in std.complex