Re: Arg[z] that works with zero argument?
- To: mathgroup at smc.vnet.net
- Subject: [mg50863] Re: [mg50860] Arg[z] that works with zero argument?
- From: "Maxim A. Dubinnyi" <maxim at nmr.ru>
- Date: Sat, 25 Sep 2004 01:55:01 -0400 (EDT)
- References: <200409240841.EAA21781@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
One possible solution is: Unprotect[Arg]; Arg[z_] /; Chop[z] == 0 = 0; Protect[Arg]; The result is: (In[]) {Arg[0], Arg[0.], Arg[1.*^-15 + 1.*^-12I], Arg[{0., I}]} (Out[]) {0, 0, 0, {0, Pi/2}} AES/newspost wrote: >I'd like a simple Arg[z] function that would "work" [return some simple >value; zero is OK] for zero argument values, even if z is a list. > >My simplest kludge so far is > > myArg[z_] := Module[{eps=10^(-17)}, Arg[z+eps]] > >Seems to work OK so far -- better ways to do this? > > >
- References:
- Arg[z] that works with zero argument?
- From: AES/newspost <siegman@stanford.edu>
- Arg[z] that works with zero argument?