Bug 11654 – std.complex.arg should return a value in the range 0 <= theta < 2*PI
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-30T09:12:00Z
Last change time
2013-11-30T09:20:59Z
Assigned to
nobody
Creator
joseph.wakeling
Comments
Comment #0 by joseph.wakeling — 2013-11-30T09:12:38Z
It ought to simplify handling (and testing) complex numbers if we constrain the argument (i.e. angle theta in polar coordinate form) of complex numbers to fall within the range [0, 2 * PI).
Example case: should arg(complex(-1.0, 0)) be PI or -PI?
Comment #1 by joseph.wakeling — 2013-11-30T09:20:59Z
Sorry; this is nonsense, it ought to return a value in the range (-PI, PI]. The problem is that arg() is returning a value of -PI.