#2589 carg range isn't (-%pi,%pi]

None
open
nobody
None
5
2013-12-23
2013-06-06
Barton Willis
No

OK:
(%i25) carg(exp(%i*x));
(%o25) atan2(sin(x),cos(x))

Not OK:
(%i26) carg(-exp(%i*x));
(%o26) atan2(sin(x),cos(x))+%pi

(%i27) subst(x=%pi/4,%);
(%o27) (5*%pi)/4

The user documentation for carg says:

 Returns the complex argument of <z>.  The complex argument is an
 angle `theta' in `(-%pi, %pi]' such that `r exp (theta %i) = <z>'

Discussion